mirror of https://github.com/go-gitea/gitea
Enable TestGiteaUploadRepo only when token
This commit is contained in:
parent
78a00af8d4
commit
87c92384df
|
@ -30,13 +30,18 @@ import (
|
|||
)
|
||||
|
||||
func TestGiteaUploadRepo(t *testing.T) {
|
||||
token := os.Getenv("GITHUB_READ_TOKEN")
|
||||
if token == "" {
|
||||
t.Skip("Skipping GitHub migration test because GITHUB_READ_TOKEN is empty")
|
||||
}
|
||||
|
||||
unittest.PrepareTestEnv(t)
|
||||
|
||||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
|
||||
|
||||
var (
|
||||
ctx = context.Background()
|
||||
downloader = NewGithubDownloaderV3(ctx, "https://github.com", "", "", "", "go-xorm", "builder")
|
||||
downloader = NewGithubDownloaderV3(ctx, "https://github.com", "", "", token, "go-xorm", "builder")
|
||||
repoName = "builder-" + time.Now().Format("2006-01-02-15-04-05")
|
||||
uploader = NewGiteaLocalUploader(graceful.GetManager().HammerContext(), user, user.Name, repoName)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue