diff options
Diffstat (limited to 'bug/bug_actions_test.go')
-rw-r--r-- | bug/bug_actions_test.go | 149 |
1 files changed, 76 insertions, 73 deletions
diff --git a/bug/bug_actions_test.go b/bug/bug_actions_test.go index 4327ae58..95ca01c9 100644 --- a/bug/bug_actions_test.go +++ b/bug/bug_actions_test.go @@ -77,17 +77,20 @@ func TestPushPull(t *testing.T) { repoA, repoB, remote := setupRepos(t) defer cleanupRepos(repoA, repoB, remote) + err := rene.Commit(repoA) + assert.NoError(t, err) + bug1, _, err := Create(rene, unix, "bug1", "message") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) // A --> remote --> B _, err = Push(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) err = Pull(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) bugs := allBugs(t, ReadAllLocalBugs(repoB)) @@ -97,15 +100,15 @@ func TestPushPull(t *testing.T) { // B --> remote --> A bug2, _, err := Create(rene, unix, "bug2", "message") - assert.Nil(t, err) + assert.NoError(t, err) err = bug2.Commit(repoB) - assert.Nil(t, err) + assert.NoError(t, err) _, err = Push(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) err = Pull(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) bugs = allBugs(t, ReadAllLocalBugs(repoA)) @@ -140,37 +143,37 @@ func _RebaseTheirs(t testing.TB) { defer cleanupRepos(repoA, repoB, remote) bug1, _, err := Create(rene, unix, "bug1", "message") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) // A --> remote _, err = Push(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) // remote --> B err = Pull(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) bug2, err := ReadLocalBug(repoB, bug1.Id()) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message2") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message3") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message4") - assert.Nil(t, err) + assert.NoError(t, err) err = bug2.Commit(repoB) - assert.Nil(t, err) + assert.NoError(t, err) // B --> remote _, err = Push(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) // remote --> A err = Pull(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) bugs := allBugs(t, ReadAllLocalBugs(repoB)) @@ -179,7 +182,7 @@ func _RebaseTheirs(t testing.TB) { } bug3, err := ReadLocalBug(repoA, bug1.Id()) - assert.Nil(t, err) + assert.NoError(t, err) if nbOps(bug3) != 4 { t.Fatal("Unexpected number of operations") @@ -201,48 +204,48 @@ func _RebaseOurs(t testing.TB) { defer cleanupRepos(repoA, repoB, remote) bug1, _, err := Create(rene, unix, "bug1", "message") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) // A --> remote _, err = Push(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) // remote --> B err = Pull(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message2") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message3") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message4") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message5") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message6") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message7") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message8") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message9") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message10") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) // remote --> A err = Pull(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) bugs := allBugs(t, ReadAllLocalBugs(repoA)) @@ -251,7 +254,7 @@ func _RebaseOurs(t testing.TB) { } bug2, err := ReadLocalBug(repoA, bug1.Id()) - assert.Nil(t, err) + assert.NoError(t, err) if nbOps(bug2) != 10 { t.Fatal("Unexpected number of operations") @@ -282,82 +285,82 @@ func _RebaseConflict(t testing.TB) { defer cleanupRepos(repoA, repoB, remote) bug1, _, err := Create(rene, unix, "bug1", "message") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) // A --> remote _, err = Push(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) // remote --> B err = Pull(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message2") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message3") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message4") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message5") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message6") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message7") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message8") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message9") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug1, rene, unix, "message10") - assert.Nil(t, err) + assert.NoError(t, err) err = bug1.Commit(repoA) - assert.Nil(t, err) + assert.NoError(t, err) bug2, err := ReadLocalBug(repoB, bug1.Id()) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message11") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message12") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message13") - assert.Nil(t, err) + assert.NoError(t, err) err = bug2.Commit(repoB) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message14") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message15") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message16") - assert.Nil(t, err) + assert.NoError(t, err) err = bug2.Commit(repoB) - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message17") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message18") - assert.Nil(t, err) + assert.NoError(t, err) _, err = AddComment(bug2, rene, unix, "message19") - assert.Nil(t, err) + assert.NoError(t, err) err = bug2.Commit(repoB) - assert.Nil(t, err) + assert.NoError(t, err) // A --> remote _, err = Push(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) // remote --> B err = Pull(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) bugs := allBugs(t, ReadAllLocalBugs(repoB)) @@ -366,7 +369,7 @@ func _RebaseConflict(t testing.TB) { } bug3, err := ReadLocalBug(repoB, bug1.Id()) - assert.Nil(t, err) + assert.NoError(t, err) if nbOps(bug3) != 19 { t.Fatal("Unexpected number of operations") @@ -374,11 +377,11 @@ func _RebaseConflict(t testing.TB) { // B --> remote _, err = Push(repoB, "origin") - assert.Nil(t, err) + assert.NoError(t, err) // remote --> A err = Pull(repoA, "origin") - assert.Nil(t, err) + assert.NoError(t, err) bugs = allBugs(t, ReadAllLocalBugs(repoA)) @@ -387,7 +390,7 @@ func _RebaseConflict(t testing.TB) { } bug4, err := ReadLocalBug(repoA, bug1.Id()) - assert.Nil(t, err) + assert.NoError(t, err) if nbOps(bug4) != 19 { t.Fatal("Unexpected number of operations") |