Skip to content

Commit ff4dd72

Browse files
garymoonLoïc Dachary
authored and
Loïc Dachary
committed
upstream: 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 go-gitea/gitea#21739 Signed-off-by: Gary Moon <[email protected]> (cherry picked from commit 40229a7)
1 parent 9bccc60 commit ff4dd72

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)