Migrate ReleaseKit to the vanity module path and new Gitea host
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/ReleaseKit/cmd/releasekit/internal/cli"
|
||||
"go.maximumdirect.net/releasekit/cmd/releasekit/internal/cli"
|
||||
)
|
||||
|
||||
func TestWoodpeckerTagDeliveryTemplate(t *testing.T) {
|
||||
@@ -205,7 +205,7 @@ func TestWoodpeckerTagDeliveryUsesTaggedModuleVersion(t *testing.T) {
|
||||
t.Run("older tag retry uses its committed module selection", func(t *testing.T) {
|
||||
goDir, goLog := installGoBootstrapShim(t)
|
||||
repository := newCLIRepository(t)
|
||||
const module = "gitea.maximumdirect.net/eric/ReleaseKit"
|
||||
const module = "go.maximumdirect.net/releasekit"
|
||||
writeRepositoryFile(t, repository, "go.mod", "module example.com/cli-candidate\n\ngo 1.25.0\n\nrequire "+module+" v0.2.197\n")
|
||||
cliGitRun(t, repository, "add", "go.mod")
|
||||
cliGitRun(t, repository, "commit", "-m", "select the earlier ReleaseKit version")
|
||||
@@ -239,7 +239,7 @@ func TestWoodpeckerTagDeliveryUsesTaggedModuleVersion(t *testing.T) {
|
||||
t.Run("versioned replacement selects its declared source", func(t *testing.T) {
|
||||
goDir, goLog := installGoBootstrapShim(t)
|
||||
repository := newCLIRepository(t)
|
||||
const module = "gitea.maximumdirect.net/eric/ReleaseKit"
|
||||
const module = "go.maximumdirect.net/releasekit"
|
||||
goMod := "module example.com/cli-candidate\n\ngo 1.25.0\n\nrequire " + module + " v0.2.197\n\nreplace " + module + " v0.2.197 => " + module + " v0.2.198\n"
|
||||
writeRepositoryFile(t, repository, "go.mod", goMod)
|
||||
cliGitRun(t, repository, "add", "go.mod")
|
||||
@@ -480,7 +480,7 @@ func templateEnvironment(repository, commit, shimDir, goLog string) map[string]s
|
||||
"CI_COMMIT_SHA": commit,
|
||||
"CI_COMMIT_TAG": "v1.2.3",
|
||||
"RELEASEKIT_GITEA_TOKEN": "fixture-token",
|
||||
"RELEASEKIT_MODULE": "gitea.maximumdirect.net/eric/ReleaseKit",
|
||||
"RELEASEKIT_MODULE": "go.maximumdirect.net/releasekit",
|
||||
"RELEASEKIT_REAL_GO": realGo,
|
||||
"RELEASEKIT_GO_LOG": goLog,
|
||||
"GOTOOLCHAIN": "local",
|
||||
@@ -513,7 +513,7 @@ func executeWoodpeckerBlock(block, repository string, environment map[string]str
|
||||
|
||||
func selectReleaseKitModule(t *testing.T, repository, releaseKitSource string, includeSum bool) {
|
||||
t.Helper()
|
||||
const module = "gitea.maximumdirect.net/eric/ReleaseKit"
|
||||
const module = "go.maximumdirect.net/releasekit"
|
||||
goMod := fmt.Sprintf("module example.com/tagged-app\n\ngo 1.26.0\n\nrequire %s v0.2.0\n\nreplace %s => %s\n", module, module, strconv.Quote(releaseKitSource))
|
||||
writeRepositoryFile(t, repository, "go.mod", goMod)
|
||||
cliGitRun(t, repository, "add", "go.mod")
|
||||
@@ -526,7 +526,7 @@ func selectReleaseKitModule(t *testing.T, repository, releaseKitSource string, i
|
||||
|
||||
func writeReleaseKitModuleProxy(t *testing.T) string {
|
||||
t.Helper()
|
||||
const module = "gitea.maximumdirect.net/eric/ReleaseKit"
|
||||
const module = "go.maximumdirect.net/releasekit"
|
||||
const toolDependency = "example.com/releasekit-helper"
|
||||
proxyDir := t.TempDir()
|
||||
toolModule := "module " + module + "\n\ngo 1.25.0\n\nrequire " + toolDependency + " v1.0.0\n"
|
||||
@@ -634,7 +634,7 @@ func assertGoSelection(t *testing.T, repository, goLog string) {
|
||||
log := readWoodpeckerFixtureFile(t, goLog)
|
||||
list := "list -mod=mod -modfile="
|
||||
build := "build -mod=mod -modfile="
|
||||
module := "gitea.maximumdirect.net/eric/ReleaseKit"
|
||||
module := "go.maximumdirect.net/releasekit"
|
||||
if !strings.Contains(log, "GOWORK=off GOTOOLCHAIN=local") || !strings.Contains(log, list) || !strings.Contains(log, "-m "+module) {
|
||||
t.Fatalf("Go module selection command is missing required settings: %q", log)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user