Skip to content

Commit

Permalink
Skip GitHub migration tests if the API token is undefined (go-gitea#2…
Browse files Browse the repository at this point in the history
…1824)

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]>
(cherry picked from commit af149bd91f5b042ba108aa972eba832c0ce085b1)
  • Loading branch information
garymoon authored and Loïc Dachary committed Feb 20, 2023
1 parent 4c7786b commit ee09afb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion services/migrations/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import (

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

Expand Down

0 comments on commit ee09afb

Please sign in to comment.