aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github/import_integration_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/github/import_integration_test.go')
-rw-r--r--bridge/github/import_integration_test.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/bridge/github/import_integration_test.go b/bridge/github/import_integration_test.go
index 50cbd5c8..6a41517c 100644
--- a/bridge/github/import_integration_test.go
+++ b/bridge/github/import_integration_test.go
@@ -34,8 +34,11 @@ func TestGithubImporterIntegration(t *testing.T) {
// arrange
repo := repository.CreateGoGitTestRepo(t, false)
- backend, err := cache.NewRepoCache(repo)
+ backend, buildEvents, err := cache.NewRepoCache(repo)
require.NoError(t, err)
+ for event := range buildEvents {
+ require.NoError(t, event.Err)
+ }
defer backend.Close()
interrupt.RegisterCleaner(backend.Close)
require.NoError(t, err)
@@ -48,17 +51,17 @@ func TestGithubImporterIntegration(t *testing.T) {
for e := range events {
require.NoError(t, e.Err)
}
- require.Len(t, backend.AllBugsIds(), 5)
- require.Len(t, backend.AllIdentityIds(), 2)
+ require.Len(t, backend.Bugs().AllIds(), 5)
+ require.Len(t, backend.Identities().AllIds(), 2)
- b1, err := backend.ResolveBugCreateMetadata(metaKeyGithubUrl, "https://github.com/marcus/to-himself/issues/1")
+ b1, err := backend.Bugs().ResolveBugCreateMetadata(metaKeyGithubUrl, "https://github.com/marcus/to-himself/issues/1")
require.NoError(t, err)
ops1 := b1.Snapshot().Operations
require.Equal(t, "marcus", ops1[0].Author().Name())
require.Equal(t, "title 1", ops1[0].(*bug.CreateOperation).Title)
require.Equal(t, "body text 1", ops1[0].(*bug.CreateOperation).Message)
- b3, err := backend.ResolveBugCreateMetadata(metaKeyGithubUrl, "https://github.com/marcus/to-himself/issues/3")
+ b3, err := backend.Bugs().ResolveBugCreateMetadata(metaKeyGithubUrl, "https://github.com/marcus/to-himself/issues/3")
require.NoError(t, err)
ops3 := b3.Snapshot().Operations
require.Equal(t, "issue 3 comment 1", ops3[1].(*bug.AddCommentOperation).Message)
@@ -66,7 +69,7 @@ func TestGithubImporterIntegration(t *testing.T) {
require.Equal(t, []bug.Label{"bug"}, ops3[3].(*bug.LabelChangeOperation).Added)
require.Equal(t, "title 3, edit 1", ops3[4].(*bug.SetTitleOperation).Title)
- b4, err := backend.ResolveBugCreateMetadata(metaKeyGithubUrl, "https://github.com/marcus/to-himself/issues/4")
+ b4, err := backend.Bugs().ResolveBugCreateMetadata(metaKeyGithubUrl, "https://github.com/marcus/to-himself/issues/4")
require.NoError(t, err)
ops4 := b4.Snapshot().Operations
require.Equal(t, "edited", ops4[1].(*bug.EditCommentOperation).Message)