From be492bd1e78717a54717c183983845be3234c236 Mon Sep 17 00:00:00 2001 From: Kelly Merrick Date: Thu, 5 Oct 2023 08:20:05 -0500 Subject: [PATCH] test: update main to be default (#521) --- executor/executor_test.go | 6 +++--- executor/linux/linux_test.go | 6 +++--- executor/local/local_test.go | 6 +++--- internal/build/snapshot_test.go | 6 +++--- internal/build/upload_test.go | 6 +++--- internal/service/environment_test.go | 6 +++--- internal/service/snapshot_test.go | 6 +++--- internal/service/upload_test.go | 6 +++--- internal/step/environment_test.go | 6 +++--- internal/step/skip_test.go | 24 ++++++++++++------------ internal/step/snapshot_test.go | 12 ++++++------ internal/step/upload_test.go | 6 +++--- mock/worker/build.go | 4 ++-- mock/worker/pipeline.go | 2 +- mock/worker/repo.go | 2 +- runtime/testdata/steps.yml | 2 +- 16 files changed, 53 insertions(+), 53 deletions(-) diff --git a/executor/executor_test.go b/executor/executor_test.go index 108a9cd6..a26b079c 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -227,8 +227,8 @@ var ( Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -274,7 +274,7 @@ var ( FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/executor/linux/linux_test.go b/executor/linux/linux_test.go index 2f4000f1..7fa65d59 100644 --- a/executor/linux/linux_test.go +++ b/executor/linux/linux_test.go @@ -192,8 +192,8 @@ func testBuild() *library.Build { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -211,7 +211,7 @@ func testRepo() *library.Repo { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/executor/local/local_test.go b/executor/local/local_test.go index 37992945..f240e312 100644 --- a/executor/local/local_test.go +++ b/executor/local/local_test.go @@ -190,8 +190,8 @@ func testBuild() *library.Build { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -209,7 +209,7 @@ func testRepo() *library.Repo { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/internal/build/snapshot_test.go b/internal/build/snapshot_test.go index a98c0718..04de9d38 100644 --- a/internal/build/snapshot_test.go +++ b/internal/build/snapshot_test.go @@ -34,8 +34,8 @@ func TestBuild_Snapshot(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -49,7 +49,7 @@ func TestBuild_Snapshot(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/internal/build/upload_test.go b/internal/build/upload_test.go index 25aba480..fb43c0a1 100644 --- a/internal/build/upload_test.go +++ b/internal/build/upload_test.go @@ -34,8 +34,8 @@ func TestBuild_Upload(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -58,7 +58,7 @@ func TestBuild_Upload(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/internal/service/environment_test.go b/internal/service/environment_test.go index b00fa8c1..a3820044 100644 --- a/internal/service/environment_test.go +++ b/internal/service/environment_test.go @@ -35,8 +35,8 @@ func TestService_Environment(t *testing.T) { b.SetAuthor("OctoKitty") b.SetEmail("OctoKitty@github.com") b.SetLink("https://example.company.com/github/octocat/1") - b.SetBranch("master") - b.SetRef("refs/heads/master") + b.SetBranch("main") + b.SetRef("refs/heads/main") b.SetBaseRef("") b.SetHeadRef("changes") b.SetHost("example.company.com") @@ -61,7 +61,7 @@ func TestService_Environment(t *testing.T) { r.SetFullName("github/octocat") r.SetLink("https://github.com/github/octocat") r.SetClone("https://github.com/github/octocat.git") - r.SetBranch("master") + r.SetBranch("main") r.SetTimeout(30) r.SetVisibility("public") r.SetPrivate(false) diff --git a/internal/service/snapshot_test.go b/internal/service/snapshot_test.go index bf38aa66..6b7309ca 100644 --- a/internal/service/snapshot_test.go +++ b/internal/service/snapshot_test.go @@ -34,8 +34,8 @@ func TestService_Snapshot(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -72,7 +72,7 @@ func TestService_Snapshot(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/internal/service/upload_test.go b/internal/service/upload_test.go index 904cde80..fb1ae028 100644 --- a/internal/service/upload_test.go +++ b/internal/service/upload_test.go @@ -34,8 +34,8 @@ func TestService_Upload(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -70,7 +70,7 @@ func TestService_Upload(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/internal/step/environment_test.go b/internal/step/environment_test.go index 93323dc2..b344f07e 100644 --- a/internal/step/environment_test.go +++ b/internal/step/environment_test.go @@ -35,8 +35,8 @@ func TestStep_Environment(t *testing.T) { b.SetAuthor("OctoKitty") b.SetEmail("OctoKitty@github.com") b.SetLink("https://example.company.com/github/octocat/1") - b.SetBranch("master") - b.SetRef("refs/heads/master") + b.SetBranch("main") + b.SetRef("refs/heads/main") b.SetBaseRef("") b.SetHeadRef("changes") b.SetHost("example.company.com") @@ -60,7 +60,7 @@ func TestStep_Environment(t *testing.T) { r.SetFullName("github/octocat") r.SetLink("https://github.com/github/octocat") r.SetClone("https://github.com/github/octocat.git") - r.SetBranch("master") + r.SetBranch("main") r.SetTimeout(30) r.SetVisibility("public") r.SetPrivate(false) diff --git a/internal/step/skip_test.go b/internal/step/skip_test.go index 620362fd..a7fe2e64 100644 --- a/internal/step/skip_test.go +++ b/internal/step/skip_test.go @@ -32,8 +32,8 @@ func TestStep_Skip(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -60,8 +60,8 @@ func TestStep_Skip(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -88,8 +88,8 @@ func TestStep_Skip(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -116,7 +116,7 @@ func TestStep_Skip(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), + Branch: vela.String("main"), Ref: vela.String("refs/tags/v1.0.0"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), @@ -144,8 +144,8 @@ func TestStep_Skip(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -172,8 +172,8 @@ func TestStep_Skip(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -197,7 +197,7 @@ func TestStep_Skip(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/internal/step/snapshot_test.go b/internal/step/snapshot_test.go index 0d4556c9..4ffa75c1 100644 --- a/internal/step/snapshot_test.go +++ b/internal/step/snapshot_test.go @@ -34,8 +34,8 @@ func TestStep_Snapshot(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -70,7 +70,7 @@ func TestStep_Snapshot(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), @@ -163,8 +163,8 @@ func TestStep_SnapshotInit(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -199,7 +199,7 @@ func TestStep_SnapshotInit(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/internal/step/upload_test.go b/internal/step/upload_test.go index 77522cfe..e689d83a 100644 --- a/internal/step/upload_test.go +++ b/internal/step/upload_test.go @@ -34,8 +34,8 @@ func TestStep_Upload(t *testing.T) { Commit: vela.String("48afb5bdc41ad69bf22588491333f7cf71135163"), Sender: vela.String("OctoKitty"), Author: vela.String("OctoKitty"), - Branch: vela.String("master"), - Ref: vela.String("refs/heads/master"), + Branch: vela.String("main"), + Ref: vela.String("refs/heads/main"), BaseRef: vela.String(""), Host: vela.String("example.company.com"), Runtime: vela.String("docker"), @@ -70,7 +70,7 @@ func TestStep_Upload(t *testing.T) { FullName: vela.String("github/octocat"), Link: vela.String("https://github.com/github/octocat"), Clone: vela.String("https://github.com/github/octocat.git"), - Branch: vela.String("master"), + Branch: vela.String("main"), Timeout: vela.Int64(60), Visibility: vela.String("public"), Private: vela.Bool(false), diff --git a/mock/worker/build.go b/mock/worker/build.go index e4bc70b0..761c92b5 100644 --- a/mock/worker/build.go +++ b/mock/worker/build.go @@ -37,8 +37,8 @@ const ( "author": "OctoKitty", "email": "octokitty@github.com", "link": "https://vela.example.company.com/github/octocat/1", - "branch": "master", - "ref": "refs/heads/master", + "branch": "main", + "ref": "refs/heads/main", "base_ref": "", "host": "example.company.com", "runtime": "docker", diff --git a/mock/worker/pipeline.go b/mock/worker/pipeline.go index 278d8e57..b4d0f873 100644 --- a/mock/worker/pipeline.go +++ b/mock/worker/pipeline.go @@ -22,7 +22,7 @@ const ( "commit": "48afb5bdc41ad69bf22588491333f7cf71135163", "flavor": "", "platform": "", - "ref": "refs/heads/master", + "ref": "refs/heads/main", "type": "yaml", "version": "1", "external_secrets": false, diff --git a/mock/worker/repo.go b/mock/worker/repo.go index dba23dfa..60156766 100644 --- a/mock/worker/repo.go +++ b/mock/worker/repo.go @@ -23,7 +23,7 @@ const ( "full_name": "github/octocat", "link": "https://github.com/github/octocat", "clone": "https://github.com/github/octocat", - "branch": "master", + "branch": "main", "build_limit": 10, "timeout": 60, "visibility": "public", diff --git a/runtime/testdata/steps.yml b/runtime/testdata/steps.yml index 1410a03c..190f7498 100644 --- a/runtime/testdata/steps.yml +++ b/runtime/testdata/steps.yml @@ -7,7 +7,7 @@ steps: pull: true parameters: path: hello-world - ref: refs/heads/master + ref: refs/heads/main remote: https://github.com/octocat/hello-world.git sha: 7fd1a60b01f91b314f59955a4e4d4e80d8edf11d