diff options
author | Gary Moon <garymoon@users.noreply.github.com> | 2022-11-15 15:22:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 15:22:16 -0500 |
commit | 40229a7dd8edc0f07fb1982c0912fdf4df083871 (patch) | |
tree | 279cebdecc17ca614af2928d228413e955460667 /services | |
parent | 6c8ff32511f4295fa381a0144a7200e4eff273d6 (diff) | |
download | gitea-40229a7dd8edc0f07fb1982c0912fdf4df083871.tar.gz gitea-40229a7dd8edc0f07fb1982c0912fdf4df083871.zip |
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 https://github.com/go-gitea/gitea/issues/21739
Signed-off-by: Gary Moon <gary@garymoon.net>
Diffstat (limited to 'services')
-rw-r--r-- | services/migrations/github_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/migrations/github_test.go b/services/migrations/github_test.go index 90c1fcaef5..7bbbbb6168 100644 --- a/services/migrations/github_test.go +++ b/services/migrations/github_test.go @@ -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) |