aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-08 17:35:35 +0100
committerMichael Muré <batolettre@gmail.com>2020-02-08 17:35:35 +0100
commit2e7ac569ad3146e5fa22907d8a4e63d2a524533b (patch)
tree806fb2e4e6f0c187c7e6ead0297135740a19ca95
parent20ca2bc0984f089a45286002a429d51746b0febb (diff)
downloadgit-bug-2e7ac569ad3146e5fa22907d8a4e63d2a524533b.tar.gz
fix tests ?
-rw-r--r--bridge/github/export_test.go12
-rw-r--r--bridge/gitlab/export_test.go8
2 files changed, 10 insertions, 10 deletions
diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go
index 89040d8f..36d43173 100644
--- a/bridge/github/export_test.go
+++ b/bridge/github/export_test.go
@@ -155,6 +155,11 @@ func TestPushPull(t *testing.T) {
defer backend.Close()
interrupt.RegisterCleaner(backend.Close)
+ token := auth.NewToken(envToken, target)
+ token.SetMetadata(auth.MetaKeyLogin, login)
+ err = auth.Store(repo, token)
+ require.NoError(t, err)
+
tests := testCases(t, backend)
// generate project name
@@ -178,11 +183,6 @@ func TestPushPull(t *testing.T) {
return deleteRepository(projectName, envUser, envToken)
})
- token := auth.NewToken(envToken, target)
- token.SetMetadata(auth.MetaKeyLogin, login)
- err = auth.Store(repo, token)
- require.NoError(t, err)
-
// initialize exporter
exporter := &githubExporter{}
err = exporter.Init(backend, core.Configuration{
@@ -258,7 +258,7 @@ func TestPushPull(t *testing.T) {
// verify bug have same number of original operations
require.Len(t, importedBug.Snapshot().Operations, tt.numOrOp)
- // verify bugs are taged with origin=github
+ // verify bugs are tagged with origin=github
issueOrigin, ok := importedBug.Snapshot().GetCreateMetadata(core.MetaKeyOrigin)
require.True(t, ok)
require.Equal(t, issueOrigin, target)
diff --git a/bridge/gitlab/export_test.go b/bridge/gitlab/export_test.go
index 50dbd04a..8410ebba 100644
--- a/bridge/gitlab/export_test.go
+++ b/bridge/gitlab/export_test.go
@@ -160,13 +160,13 @@ func TestPushPull(t *testing.T) {
defer backend.Close()
interrupt.RegisterCleaner(backend.Close)
- tests := testCases(t, backend)
-
token := auth.NewToken(envToken, target)
- token.SetMetadata(metaKeyGitlabLogin, login)
+ token.SetMetadata(auth.MetaKeyLogin, login)
err = auth.Store(repo, token)
require.NoError(t, err)
+ tests := testCases(t, backend)
+
// generate project name
projectName := generateRepoName()
@@ -263,7 +263,7 @@ func TestPushPull(t *testing.T) {
// verify bug have same number of original operations
require.Len(t, importedBug.Snapshot().Operations, tt.numOpImp)
- // verify bugs are taged with origin=gitlab
+ // verify bugs are tagged with origin=gitlab
issueOrigin, ok := importedBug.Snapshot().GetCreateMetadata(core.MetaKeyOrigin)
require.True(t, ok)
require.Equal(t, issueOrigin, target)