feat: vendor gitea 1.16.2
This commit is contained in:
@@ -17,16 +17,17 @@ import (
|
||||
)
|
||||
|
||||
func TestGiteaDownloadRepo(t *testing.T) {
|
||||
// Skip tests if Gitea token is not found
|
||||
giteaToken := os.Getenv("GITEA_TOKEN")
|
||||
// Skip tests if Gitea token is not found (TODO: this test seems stopped for long time because there is no token in CI secrets)
|
||||
giteaToken := os.Getenv("GITEA_TEST_OFFICIAL_SITE_TOKEN")
|
||||
if giteaToken == "" {
|
||||
t.Skip("skipped test because GITEA_TOKEN was not in the environment")
|
||||
t.Skip("skipped test because GITEA_TEST_OFFICIAL_SITE_TOKEN was not in the environment")
|
||||
}
|
||||
|
||||
resp, err := http.Get("https://gitea.com/gitea")
|
||||
if err != nil || resp.StatusCode != http.StatusOK {
|
||||
t.Skipf("Can't reach https://gitea.com, skipping %s", t.Name())
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
ctx := t.Context()
|
||||
downloader, err := NewGiteaDownloader(ctx, "https://gitea.com", "gitea/test_repo", "", "", giteaToken)
|
||||
require.NoError(t, err, "NewGiteaDownloader error occur")
|
||||
@@ -85,16 +86,16 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
||||
{
|
||||
Title: "V2 Finalize",
|
||||
Created: time.Unix(0, 0),
|
||||
Deadline: timePtr(time.Unix(1599263999, 0)),
|
||||
Updated: timePtr(time.Unix(0, 0)),
|
||||
Deadline: new(time.Unix(1599263999, 0)),
|
||||
Updated: new(time.Unix(0, 0)),
|
||||
State: "open",
|
||||
},
|
||||
{
|
||||
Title: "V1",
|
||||
Description: "Generate Content",
|
||||
Created: time.Unix(0, 0),
|
||||
Updated: timePtr(time.Unix(0, 0)),
|
||||
Closed: timePtr(time.Unix(1598985406, 0)),
|
||||
Updated: new(time.Unix(0, 0)),
|
||||
Closed: new(time.Unix(1598985406, 0)),
|
||||
State: "closed",
|
||||
},
|
||||
}, milestones)
|
||||
@@ -170,7 +171,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
||||
Content: "laugh",
|
||||
},
|
||||
},
|
||||
Closed: timePtr(time.Date(2020, 9, 1, 15, 49, 34, 0, time.UTC)),
|
||||
Closed: new(time.Date(2020, 9, 1, 15, 49, 34, 0, time.UTC)),
|
||||
},
|
||||
{
|
||||
Number: 2,
|
||||
@@ -189,7 +190,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
||||
Color: "d4c5f9",
|
||||
Description: "",
|
||||
}},
|
||||
Closed: timePtr(time.Unix(1598969497, 0)),
|
||||
Closed: new(time.Unix(1598969497, 0)),
|
||||
},
|
||||
}, issues)
|
||||
|
||||
@@ -236,7 +237,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
||||
IsLocked: false,
|
||||
Created: time.Unix(1598982759, 0),
|
||||
Updated: time.Unix(1599023425, 0),
|
||||
Closed: timePtr(time.Unix(1598982934, 0)),
|
||||
Closed: new(time.Unix(1598982934, 0)),
|
||||
Assignees: []string{"techknowlogick"},
|
||||
Base: base.PullRequestBranch{
|
||||
CloneURL: "",
|
||||
@@ -253,7 +254,7 @@ func TestGiteaDownloadRepo(t *testing.T) {
|
||||
OwnerName: "6543-forks",
|
||||
},
|
||||
Merged: true,
|
||||
MergedTime: timePtr(time.Unix(1598982934, 0)),
|
||||
MergedTime: new(time.Unix(1598982934, 0)),
|
||||
MergeCommitSHA: "827aa28a907853e5ddfa40c8f9bc52471a2685fd",
|
||||
PatchURL: "https://gitea.com/gitea/test_repo/pulls/12.patch",
|
||||
}, prs[1])
|
||||
|
||||
Reference in New Issue
Block a user