Skip to content

Commit 7417afd

Browse files
committed
fix vendor
1 parent 78d75c5 commit 7417afd

File tree

2 files changed

+126
-0
lines changed

2 files changed

+126
-0
lines changed

modules/migrations/gogs_test.go

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Copyright 2019 The Gitea Authors. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package migrations
6+
7+
import (
8+
"net/http"
9+
"testing"
10+
"time"
11+
12+
"code.gitea.io/gitea/modules/migrations/base"
13+
14+
"github.com/stretchr/testify/assert"
15+
)
16+
17+
func TestGogsDownloadRepo(t *testing.T) {
18+
resp, err := http.Get("https://try.gogs.io/lunnytest/TESTREPO")
19+
if err != nil || resp.StatusCode/100 != 2 {
20+
// skip and don't run test
21+
t.Skipf("visit test repo failed, ignored")
22+
return
23+
}
24+
25+
downloader := NewGogsDownloader("https://try.gogs.io", "c109b3c905eb57951cfdea270cfcfdc297a74500", "", "lunnytest", "TESTREPO")
26+
repo, err := downloader.GetRepoInfo()
27+
assert.NoError(t, err)
28+
29+
assert.EqualValues(t, &base.Repository{
30+
Name: "TESTREPO",
31+
Owner: "lunnytest",
32+
Description: "",
33+
CloneURL: "https://try.gogs.io/lunnytest/TESTREPO.git",
34+
}, repo)
35+
36+
milestones, err := downloader.GetMilestones()
37+
assert.NoError(t, err)
38+
assert.True(t, len(milestones) == 1)
39+
40+
for _, milestone := range milestones {
41+
switch milestone.Title {
42+
case "1.0":
43+
assert.EqualValues(t, "open", milestone.State)
44+
}
45+
}
46+
47+
labels, err := downloader.GetLabels()
48+
assert.NoError(t, err)
49+
assert.True(t, len(labels) == 7)
50+
for _, l := range labels {
51+
switch l.Name {
52+
case "bug":
53+
assertLabelEqual(t, "bug", "ee0701", l)
54+
case "duplicated":
55+
assertLabelEqual(t, "duplicated", "cccccc", l)
56+
case "enhancement":
57+
assertLabelEqual(t, "enhancement", "84b6eb", l)
58+
case "help wanted":
59+
assertLabelEqual(t, "help wanted", "128a0c", l)
60+
case "invalid":
61+
assertLabelEqual(t, "invalid", "e6e6e6", l)
62+
case "question":
63+
assertLabelEqual(t, "question", "cc317c", l)
64+
case "wontfix":
65+
assertLabelEqual(t, "wontfix", "ffffff", l)
66+
}
67+
}
68+
69+
_, err = downloader.GetReleases()
70+
assert.Error(t, err)
71+
72+
// downloader.GetIssues()
73+
issues, isEnd, err := downloader.GetIssues(1, 8)
74+
assert.NoError(t, err)
75+
assert.EqualValues(t, 1, len(issues))
76+
assert.False(t, isEnd)
77+
78+
assert.EqualValues(t, []*base.Issue{
79+
{
80+
Number: 1,
81+
Title: "test",
82+
Content: "test",
83+
Milestone: "",
84+
PosterName: "lunny",
85+
PosterEmail: "xiaolunwen@gmail.com",
86+
State: "open",
87+
Created: time.Date(2019, 06, 11, 8, 16, 44, 0, time.UTC),
88+
Labels: []*base.Label{
89+
{
90+
Name: "bug",
91+
Color: "ee0701",
92+
},
93+
},
94+
},
95+
}, issues)
96+
97+
// downloader.GetComments()
98+
comments, err := downloader.GetComments(1)
99+
assert.NoError(t, err)
100+
assert.EqualValues(t, 1, len(comments))
101+
assert.EqualValues(t, []*base.Comment{
102+
{
103+
PosterName: "lunny",
104+
PosterEmail: "xiaolunwen@gmail.com",
105+
Created: time.Date(2019, 06, 11, 8, 19, 50, 0, time.UTC),
106+
Updated: time.Date(2019, 06, 11, 8, 19, 50, 0, time.UTC),
107+
Content: `1111`,
108+
},
109+
}, comments)
110+
111+
// downloader.GetPullRequests()
112+
_, err = downloader.GetPullRequests(1, 3)
113+
assert.Error(t, err)
114+
}

vendor/modules.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ github.com/couchbase/vellum/utf8
110110
github.com/couchbaselabs/go-couchbase
111111
# github.com/davecgh/go-spew v1.1.1
112112
github.com/davecgh/go-spew/spew
113+
<<<<<<< HEAD
113114
# github.com/denisenkom/go-mssqldb v0.0.0-20190924004331-208c0a498538
115+
=======
116+
# github.com/denisenkom/go-mssqldb v0.0.0-20190121005146-b04fd42d9952 => github.com/denisenkom/go-mssqldb v0.0.0-20180315180555-6a30f4e59a44
117+
>>>>>>> fix vendor
114118
github.com/denisenkom/go-mssqldb
115119
github.com/denisenkom/go-mssqldb/internal/cp
116120
github.com/denisenkom/go-mssqldb/internal/decimal
@@ -200,13 +204,21 @@ github.com/gobwas/glob/util/runes
200204
github.com/gobwas/glob/util/strings
201205
# github.com/gogits/chardet v0.0.0-20150115103509-2404f7772561
202206
github.com/gogits/chardet
207+
<<<<<<< HEAD
203208
# github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
204209
github.com/gogs/cron
205210
# github.com/gogs/go-gogs-client v0.0.0-20190710002546-4c3c18947c15
206211
github.com/gogs/go-gogs-client
207212
# github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe
208213
github.com/golang-sql/civil
209214
# github.com/golang/protobuf v1.3.2
215+
=======
216+
# github.com/gogits/cron v0.0.0-20160810035002-7f3990acf183
217+
github.com/gogits/cron
218+
# github.com/gogs/go-gogs-client v0.0.0-20181217004319-1cd0db3113de
219+
github.com/gogs/go-gogs-client
220+
# github.com/golang/protobuf v1.3.1
221+
>>>>>>> fix vendor
210222
github.com/golang/protobuf/proto
211223
# github.com/golang/snappy v0.0.1
212224
github.com/golang/snappy

0 commit comments

Comments
 (0)