Skip to content

Commit 40229a7

Browse files
authored
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 <gary@garymoon.net>
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

+5-1
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)