From 1006007512761e1f1df114ca90c22eaf516a16d2 Mon Sep 17 00:00:00 2001 From: utam0k Date: Fri, 9 Sep 2022 17:01:54 +0900 Subject: [PATCH 1/2] test: use gitpod-io/template-golang-cli instead of gitpod-io/gitpod --- test/tests/workspace/contexts_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tests/workspace/contexts_test.go b/test/tests/workspace/contexts_test.go index 706ee4b52feeb5..eb3f387a138e96 100644 --- a/test/tests/workspace/contexts_test.go +++ b/test/tests/workspace/contexts_test.go @@ -32,8 +32,8 @@ func TestGitHubContexts(t *testing.T) { tests := []ContextTest{ { Name: "open repository", - ContextURL: "github.com/gitpod-io/gitpod", - WorkspaceRoot: "/workspace/gitpod", + ContextURL: "github.com/gitpod-io/template-golang-cli", + WorkspaceRoot: "/workspace/template-golang-cli", ExpectedBranch: "main", }, { From bff71099fd3ee8b5197da97c6b3296433018c751 Mon Sep 17 00:00:00 2001 From: utam0k Date: Fri, 9 Sep 2022 17:02:45 +0900 Subject: [PATCH 2/2] test: Workspace testing does not guarantee branch name creation --- test/tests/workspace/contexts_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/tests/workspace/contexts_test.go b/test/tests/workspace/contexts_test.go index eb3f387a138e96..dfd4be560cc5e9 100644 --- a/test/tests/workspace/contexts_test.go +++ b/test/tests/workspace/contexts_test.go @@ -6,7 +6,6 @@ package workspace import ( "context" - "fmt" "os" "testing" "time" @@ -43,12 +42,10 @@ func TestGitHubContexts(t *testing.T) { ExpectedBranch: "integration-test-1", }, { + // Branch name decisions are not tested in the workspace as it is the server side logic Name: "open issue", ContextURL: "github.com/gitpod-io/gitpod-test-repo/issues/88", WorkspaceRoot: "/workspace/gitpod-test-repo", - ExpectedBranchFunc: func(username string) string { - return fmt.Sprintf("%s/integration-88", username) - }, }, { Name: "open tag", @@ -94,9 +91,6 @@ func TestGitLabContexts(t *testing.T) { Name: "open issue", ContextURL: "gitlab.com/AlexTugarev/gp-test/issues/1", WorkspaceRoot: "/workspace/gp-test", - ExpectedBranchFunc: func(username string) string { - return fmt.Sprintf("%s/write-a-readme-1", username) - }, }, { Name: "open tag", @@ -164,6 +158,10 @@ func runContextTests(t *testing.T, tests []ContextTest) { defer rsa.Close() integration.DeferCloser(t, closer) + if test.ExpectedBranch == "" && test.ExpectedBranchFunc == nil { + return + } + // get actual from workspace git := common.Git(rsa) err = git.ConfigSafeDirectory()