Skip to content

Commit

Permalink
chore: make tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanGoasdoue committed Apr 19, 2024
1 parent 810dfa3 commit 0f6ea02
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions pkg/cmd/git/clone/clone_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package clone_test

import (
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -44,6 +45,9 @@ func TestGitClone(t *testing.T) {

t.Logf("creating git credentials file %s", o.OutputFile)

// Unset GITHUB_TOKEN for the duration of the test
os.Unsetenv("GITHUB_TOKEN")

err := o.Run()
require.NoError(t, err, "failed to run git setup")

Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/git/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ func TestGitGetFromRepository(t *testing.T) {
_, o := get.NewCmdGitGet()

o.SourceURL = "https://github.com/jenkins-x-plugins/jx-gitops"
o.Branch = "master"
// ToDo(ankitm123): Rename test_data to testdata after changes are made in go-scm
o.Branch = "main"
o.ScmClient, _ = fake.NewDefault()
o.Dir = tmpDir
o.Path = "expected.txt"
Expand Down Expand Up @@ -48,7 +47,7 @@ func TestGitGetFromEnvironment(t *testing.T) {
_, o := get.NewCmdGitGet()

o.SourceURL = "https://github.com/jenkins-x-plugins/jx-gitops"
o.Branch = "master"
o.Branch = "main"
o.ScmClient, _ = fake.NewDefault()
o.JXClient = jxClient
o.Dir = tmpDir
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/git/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ func TestGitSetup(t *testing.T) {

t.Logf("creating git credentials file %s", o.OutputFile)

// Unset GITHUB_TOKEN for the duration of the test
os.Unsetenv("GITHUB_TOKEN")

err = o.Run()
require.NoError(t, err, "failed to run git setup")

Expand Down

0 comments on commit 0f6ea02

Please sign in to comment.