aboutsummaryrefslogtreecommitdiffstats
path: root/entity
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-06-24 09:52:58 -0400
committerGitHub <noreply@github.com>2022-06-24 09:52:58 -0400
commit00b9e1a6028388b332f14ff3e607f02d589b637b (patch)
tree7e9a89ce480f537c3bbe0fb942d1bc9a1c3f758f /entity
parentb694052c46a69b47e58526068109db2fbcca92af (diff)
parentfd248de1eb5591ea977fdfcedf75d26f53636a5e (diff)
downloadgit-bug-00b9e1a6028388b332f14ff3e607f02d589b637b.tar.gz
Merge pull request #817 from MichaelMure/refactor/guarantee-test-cleanup
refactor(809): guarantee test cleanup
Diffstat (limited to 'entity')
-rw-r--r--entity/dag/common_test.go6
-rw-r--r--entity/dag/entity_actions_test.go12
2 files changed, 7 insertions, 11 deletions
diff --git a/entity/dag/common_test.go b/entity/dag/common_test.go
index 532e3ff8..c2177683 100644
--- a/entity/dag/common_test.go
+++ b/entity/dag/common_test.go
@@ -103,9 +103,9 @@ func makeTestContext() (repository.ClockedRepo, identity.Interface, identity.Int
}
func makeTestContextRemote(t *testing.T) (repository.ClockedRepo, repository.ClockedRepo, repository.ClockedRepo, identity.Interface, identity.Interface, identity.Resolver, Definition) {
- repoA := repository.CreateGoGitTestRepo(false)
- repoB := repository.CreateGoGitTestRepo(false)
- remote := repository.CreateGoGitTestRepo(true)
+ repoA := repository.CreateGoGitTestRepo(t, false)
+ repoB := repository.CreateGoGitTestRepo(t, false)
+ remote := repository.CreateGoGitTestRepo(t, true)
err := repoA.AddRemote("remote", remote.GetLocalRemote())
require.NoError(t, err)
diff --git a/entity/dag/entity_actions_test.go b/entity/dag/entity_actions_test.go
index 45e69c7d..68aa59b8 100644
--- a/entity/dag/entity_actions_test.go
+++ b/entity/dag/entity_actions_test.go
@@ -24,8 +24,7 @@ func allEntities(t testing.TB, bugs <-chan StreamedEntity) []*Entity {
}
func TestEntityPushPull(t *testing.T) {
- repoA, repoB, remote, id1, id2, resolver, def := makeTestContextRemote(t)
- defer repository.CleanupTestRepos(repoA, repoB, remote)
+ repoA, repoB, _, id1, id2, resolver, def := makeTestContextRemote(t)
// A --> remote --> B
e := New(def)
@@ -61,8 +60,7 @@ func TestEntityPushPull(t *testing.T) {
}
func TestListLocalIds(t *testing.T) {
- repoA, repoB, remote, id1, id2, resolver, def := makeTestContextRemote(t)
- defer repository.CleanupTestRepos(repoA, repoB, remote)
+ repoA, repoB, _, id1, id2, resolver, def := makeTestContextRemote(t)
// A --> remote --> B
e := New(def)
@@ -206,8 +204,7 @@ func assertNotEqualRefs(t *testing.T, repoA, repoB repository.RepoData, prefix s
}
func TestMerge(t *testing.T) {
- repoA, repoB, remote, id1, id2, resolver, def := makeTestContextRemote(t)
- defer repository.CleanupTestRepos(repoA, repoB, remote)
+ repoA, repoB, _, id1, id2, resolver, def := makeTestContextRemote(t)
// SCENARIO 1
// if the remote Entity doesn't exist locally, it's created
@@ -387,8 +384,7 @@ func TestMerge(t *testing.T) {
}
func TestRemove(t *testing.T) {
- repoA, repoB, remote, id1, _, resolver, def := makeTestContextRemote(t)
- defer repository.CleanupTestRepos(repoA, repoB, remote)
+ repoA, _, _, id1, _, resolver, def := makeTestContextRemote(t)
e := New(def)
e.Append(newOp1(id1, "foo"))