diff options
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/github/export_test.go | 12 | ||||
-rw-r--r-- | bridge/github/import_test.go | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go index 9b10020d..9d8297e4 100644 --- a/bridge/github/export_test.go +++ b/bridge/github/export_test.go @@ -5,6 +5,7 @@ import ( "context" "encoding/json" "fmt" + "log/slog" "math/rand" "net/http" "os" @@ -130,12 +131,15 @@ func testCases(t *testing.T, repo *cache.RepoCache) []*testCase { func TestGithubPushPull(t *testing.T) { // repo owner - envUser := os.Getenv("GITHUB_TEST_USER") + envUser := os.Getenv("GITHUB_USER") + if envUser == "" { + t.Skip("missing required environment variable: GITHUB_USER") + } // token must have 'repo' and 'delete_repo' scopes - envToken := os.Getenv("GITHUB_TOKEN_ADMIN") + envToken := os.Getenv("GITHUB_TOKEN") if envToken == "" { - t.Skip("Env var GITHUB_TOKEN_ADMIN missing") + t.Skip("missing required environment variable: GITHUB_TOKEN") } // create repo backend @@ -179,7 +183,7 @@ func TestGithubPushPull(t *testing.T) { err = createRepository(projectName, envToken) require.NoError(t, err) - fmt.Println("created repository", projectName) + slog.Info("created github repository", "name", projectName) // Let Github handle the repo creation and update all their internal caches. // Avoid HTTP error 404 retrieving repository node id diff --git a/bridge/github/import_test.go b/bridge/github/import_test.go index 380c09a7..f81df28c 100644 --- a/bridge/github/import_test.go +++ b/bridge/github/import_test.go @@ -22,9 +22,9 @@ import ( ) func TestGithubImporter(t *testing.T) { - envToken := os.Getenv("GITHUB_TOKEN_PRIVATE") + envToken := os.Getenv("GITHUB_TOKEN") if envToken == "" { - t.Skip("Env var GITHUB_TOKEN_PRIVATE missing") + t.Skip("missing required environment variable: GITHUB_TOKEN") } repo := repository.CreateGoGitTestRepo(t, false) |