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
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user