Skip to content

Commit a42675c

Browse files
garymoonfsologureng
authored andcommitted
Skip GitHub migration tests if the API token is undefined (go-gitea#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 go-gitea#21739 Signed-off-by: Gary Moon <[email protected]>
1 parent 4cf8c4c commit a42675c

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)