diff options
author | Michael Muré <batolettre@gmail.com> | 2022-12-21 21:54:36 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-12-21 21:54:36 +0100 |
commit | 9b98fc06489353053564b431ac0c0d73a5c55a56 (patch) | |
tree | 67cab95c0c6167c0982516a2dda610bd5ece9eab /bridge/github/import_integration_test.go | |
parent | 905c9a90f134842b97e2cf729d8b11ff59bfd766 (diff) | |
download | git-bug-9b98fc06489353053564b431ac0c0d73a5c55a56.tar.gz git-bug-9b98fc06489353053564b431ac0c0d73a5c55a56.zip |
cache: tie up the refactor up to compiling
Diffstat (limited to 'bridge/github/import_integration_test.go')
-rw-r--r-- | bridge/github/import_integration_test.go | 15 |
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) |