diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2020-01-16 16:15:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-16 16:15:44 +0100 |
commit | 11885daaa0397d02d7acd559234b098dfd239d49 (patch) | |
tree | 84743e7845f27124acf9045a0797ccafda51e2e9 /modules/migrations/github_test.go | |
parent | fdb32ab0f82843f333969487d1207db7e085caaa (diff) | |
download | gitea-11885daaa0397d02d7acd559234b098dfd239d49.tar.gz gitea-11885daaa0397d02d7acd559234b098dfd239d49.zip |
tests: configure github remaining limit + read token (#9800)
* ci: configure remaining github limmit
* prepend with github since package is common to all migrations
* add RefreshRate
* Update github.go
* add missing space
* go fmt
* Read env variable GITHUB_READ_TOKEN for token
* Update .drone.yml
Diffstat (limited to 'modules/migrations/github_test.go')
-rw-r--r-- | modules/migrations/github_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/migrations/github_test.go b/modules/migrations/github_test.go index 10943e4019..9023e2ac4d 100644 --- a/modules/migrations/github_test.go +++ b/modules/migrations/github_test.go @@ -6,6 +6,7 @@ package migrations import ( + "os" "testing" "time" @@ -62,7 +63,11 @@ func assertLabelEqual(t *testing.T, name, color, description string, label *base } func TestGitHubDownloadRepo(t *testing.T) { - downloader := NewGithubDownloaderV3("", "", "go-gitea", "test_repo") + GithubLimitRateRemaining = 3 //Wait at 3 remaining since we could have 3 CI in // + downloader := NewGithubDownloaderV3(os.Getenv("GITHUB_READ_TOKEN"), "", "go-gitea", "test_repo") + err := downloader.RefreshRate() + assert.NoError(t, err) + repo, err := downloader.GetRepoInfo() assert.NoError(t, err) assert.EqualValues(t, &base.Repository{ |