Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 40229a7

Browse files
authoredNov 15, 2022
Skip GitHub migration tests if the API token is undefined (#21824)
GitHub migration tests will be skipped if the secret for the GitHub API token hasn't been set. This change should make all tests pass (or skip in the case of this one) for anyone running the pipeline on their own infrastructure without further action on their part. Resolves #21739 Signed-off-by: Gary Moon <[email protected]>
1 parent 6c8ff32 commit 40229a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎services/migrations/github_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ import (
1818

1919
func TestGitHubDownloadRepo(t *testing.T) {
2020
GithubLimitRateRemaining = 3 // Wait at 3 remaining since we could have 3 CI in //
21-
downloader := NewGithubDownloaderV3(context.Background(), "https://github.com", "", "", os.Getenv("GITHUB_READ_TOKEN"), "go-gitea", "test_repo")
21+
token := os.Getenv("GITHUB_READ_TOKEN")
22+
if token == "" {
23+
t.Skip("Skipping GitHub migration test because GITHUB_READ_TOKEN is empty")
24+
}
25+
downloader := NewGithubDownloaderV3(context.Background(), "https://github.com", "", "", token, "go-gitea", "test_repo")
2226
err := downloader.RefreshRate()
2327
assert.NoError(t, err)
2428

0 commit comments

Comments
 (0)
Please sign in to comment.