aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-05-27 21:14:55 +0200
committerMichael Muré <batolettre@gmail.com>2019-05-27 21:14:55 +0200
commitc7abac388aadd274d4f23f996a15f8bba90f2a92 (patch)
treeced1116de500346eb340f72b7bfc672136e40c1e /bug
parent9865dfcdf0810e288283f2ef4eba450041db32f9 (diff)
downloadgit-bug-c7abac388aadd274d4f23f996a15f8bba90f2a92.tar.gz
repo: refactor how test repo are created/cleaned
Diffstat (limited to 'bug')
-rw-r--r--bug/bug_actions_test.go21
-rw-r--r--bug/operation_test.go9
2 files changed, 17 insertions, 13 deletions
diff --git a/bug/bug_actions_test.go b/bug/bug_actions_test.go
index e35a7ece..4bc58aea 100644
--- a/bug/bug_actions_test.go
+++ b/bug/bug_actions_test.go
@@ -4,14 +4,15 @@ import (
"testing"
"time"
- "github.com/MichaelMure/git-bug/identity"
- "github.com/MichaelMure/git-bug/util/test"
"github.com/stretchr/testify/require"
+
+ "github.com/MichaelMure/git-bug/identity"
+ "github.com/MichaelMure/git-bug/repository"
)
func TestPushPull(t *testing.T) {
- repoA, repoB, remote := test.SetupReposAndRemote(t)
- defer test.CleanupRepos(repoA, repoB, remote)
+ repoA, repoB, remote := repository.SetupReposAndRemote(t)
+ defer repository.CleanupTestRepos(t, repoA, repoB, remote)
reneA := identity.NewIdentity("René Descartes", "rene@descartes.fr")
@@ -83,8 +84,8 @@ func BenchmarkRebaseTheirs(b *testing.B) {
}
func _RebaseTheirs(t testing.TB) {
- repoA, repoB, remote := test.SetupReposAndRemote(t)
- defer test.CleanupRepos(repoA, repoB, remote)
+ repoA, repoB, remote := repository.SetupReposAndRemote(t)
+ defer repository.CleanupTestRepos(t, repoA, repoB, remote)
reneA := identity.NewIdentity("René Descartes", "rene@descartes.fr")
@@ -156,8 +157,8 @@ func BenchmarkRebaseOurs(b *testing.B) {
}
func _RebaseOurs(t testing.TB) {
- repoA, repoB, remote := test.SetupReposAndRemote(t)
- defer test.CleanupRepos(repoA, repoB, remote)
+ repoA, repoB, remote := repository.SetupReposAndRemote(t)
+ defer repository.CleanupTestRepos(t, repoA, repoB, remote)
reneA := identity.NewIdentity("René Descartes", "rene@descartes.fr")
@@ -245,8 +246,8 @@ func BenchmarkRebaseConflict(b *testing.B) {
}
func _RebaseConflict(t testing.TB) {
- repoA, repoB, remote := test.SetupReposAndRemote(t)
- defer test.CleanupRepos(repoA, repoB, remote)
+ repoA, repoB, remote := repository.SetupReposAndRemote(t)
+ defer repository.CleanupTestRepos(t, repoA, repoB, remote)
reneA := identity.NewIdentity("René Descartes", "rene@descartes.fr")
diff --git a/bug/operation_test.go b/bug/operation_test.go
index f9a7d191..0ddb61c2 100644
--- a/bug/operation_test.go
+++ b/bug/operation_test.go
@@ -4,11 +4,11 @@ import (
"testing"
"time"
+ "github.com/stretchr/testify/require"
+
"github.com/MichaelMure/git-bug/identity"
"github.com/MichaelMure/git-bug/repository"
"github.com/MichaelMure/git-bug/util/git"
- "github.com/MichaelMure/git-bug/util/test"
- "github.com/stretchr/testify/require"
)
func TestValidate(t *testing.T) {
@@ -80,9 +80,12 @@ func TestMetadata(t *testing.T) {
}
func TestHash(t *testing.T) {
+ repo := repository.CreateTestRepo(false)
+ defer repository.CleanupTestRepos(t, repo)
+
repos := []repository.ClockedRepo{
repository.NewMockRepoForTest(),
- test.CreateRepo(false),
+ repo,
}
for _, repo := range repos {