aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github/export_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/github/export_test.go')
-rw-r--r--bridge/github/export_test.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go
index 5a0bc653..7d6e6fb1 100644
--- a/bridge/github/export_test.go
+++ b/bridge/github/export_test.go
@@ -144,8 +144,12 @@ func TestPushPull(t *testing.T) {
require.NoError(t, err)
// set author identity
+ login := "identity-test"
author, err := backend.NewIdentity("test identity", "test@test.org")
require.NoError(t, err)
+ author.SetMetadata(metaKeyGithubLogin, login)
+ err = author.Commit()
+ require.NoError(t, err)
err = backend.SetUserIdentity(author)
require.NoError(t, err)
@@ -153,6 +157,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
@@ -176,10 +185,6 @@ func TestPushPull(t *testing.T) {
return deleteRepository(projectName, envUser, envToken)
})
- token := auth.NewToken(author.Id(), envToken, target)
- err = auth.Store(repo, token)
- require.NoError(t, err)
-
// initialize exporter
exporter := &githubExporter{}
err = exporter.Init(backend, core.Configuration{
@@ -255,7 +260,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)