Verified Commit de3d427c authored by Loïc Dachary's avatar Loïc Dachary
Browse files

tests: do not test against the GitHub API



Because we have not token and it will block after a few tries
Signed-off-by: Loïc Dachary's avatarLoïc Dachary <loic@dachary.org>
parent ff39ee4a
Pipeline #626 passed with stage
in 19 minutes and 44 seconds
......@@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"os"
"testing"
"code.gitea.io/gitea/modules/structs"
......@@ -39,6 +40,10 @@ func testRepoMigrate(t testing.TB, session *TestSession, cloneAddr, repoName str
}
func TestRepoMigrate(t *testing.T) {
if os.Getenv("GITHUB_READ_TOKEN") == "" {
t.Skip("skipped test because GITHUB_READ_TOKEN was not in the environment")
}
defer prepareTestEnv(t)()
session := loginUser(t, "user2")
testRepoMigrate(t, session, "https://github.com/go-gitea/test_repo.git", "git")
......
......@@ -17,6 +17,10 @@ import (
)
func TestGitHubDownloadRepo(t *testing.T) {
if os.Getenv("GITHUB_READ_TOKEN") == "" {
t.Skip("skipped test because GITHUB_READ_TOKEN was not in the environment")
}
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")
err := downloader.RefreshRate()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment