diff options
author | Steve Moyer <smoyer1@selesy.com> | 2022-06-24 09:52:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-24 09:52:58 -0400 |
commit | 00b9e1a6028388b332f14ff3e607f02d589b637b (patch) | |
tree | 7e9a89ce480f537c3bbe0fb942d1bc9a1c3f758f /bridge | |
parent | b694052c46a69b47e58526068109db2fbcca92af (diff) | |
parent | fd248de1eb5591ea977fdfcedf75d26f53636a5e (diff) | |
download | git-bug-00b9e1a6028388b332f14ff3e607f02d589b637b.tar.gz |
Merge pull request #817 from MichaelMure/refactor/guarantee-test-cleanup
refactor(809): guarantee test cleanup
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/github/export_test.go | 6 | ||||
-rw-r--r-- | bridge/github/import_integration_test.go | 3 | ||||
-rw-r--r-- | bridge/github/import_test.go | 3 | ||||
-rw-r--r-- | bridge/gitlab/export_test.go | 6 | ||||
-rw-r--r-- | bridge/gitlab/import_test.go | 3 |
5 files changed, 7 insertions, 14 deletions
diff --git a/bridge/github/export_test.go b/bridge/github/export_test.go index 1d1398a9..94664853 100644 --- a/bridge/github/export_test.go +++ b/bridge/github/export_test.go @@ -137,8 +137,7 @@ func TestGithubPushPull(t *testing.T) { } // create repo backend - repo := repository.CreateGoGitTestRepo(false) - defer repository.CleanupTestRepos(repo) + repo := repository.CreateGoGitTestRepo(t, false) backend, err := cache.NewRepoCache(repo) require.NoError(t, err) @@ -213,8 +212,7 @@ func TestGithubPushPull(t *testing.T) { fmt.Printf("test repository exported in %f seconds\n", time.Since(start).Seconds()) - repoTwo := repository.CreateGoGitTestRepo(false) - defer repository.CleanupTestRepos(repoTwo) + repoTwo := repository.CreateGoGitTestRepo(t, false) // create a second backend backendTwo, err := cache.NewRepoCache(repoTwo) diff --git a/bridge/github/import_integration_test.go b/bridge/github/import_integration_test.go index 3349f3f5..b969f6bd 100644 --- a/bridge/github/import_integration_test.go +++ b/bridge/github/import_integration_test.go @@ -32,8 +32,7 @@ func TestGithubImporterIntegration(t *testing.T) { importer.client = &rateLimitHandlerClient{sc: clientMock} // arrange - repo := repository.CreateGoGitTestRepo(false) - defer repository.CleanupTestRepos(repo) + repo := repository.CreateGoGitTestRepo(t, false) backend, err := cache.NewRepoCache(repo) require.NoError(t, err) defer backend.Close() diff --git a/bridge/github/import_test.go b/bridge/github/import_test.go index 324d5421..df4989a4 100644 --- a/bridge/github/import_test.go +++ b/bridge/github/import_test.go @@ -24,8 +24,7 @@ func TestGithubImporter(t *testing.T) { t.Skip("Env var GITHUB_TOKEN_PRIVATE missing") } - repo := repository.CreateGoGitTestRepo(false) - defer repository.CleanupTestRepos(repo) + repo := repository.CreateGoGitTestRepo(t, false) backend, err := cache.NewRepoCache(repo) require.NoError(t, err) diff --git a/bridge/gitlab/export_test.go b/bridge/gitlab/export_test.go index 422366c1..cca4c6ca 100644 --- a/bridge/gitlab/export_test.go +++ b/bridge/gitlab/export_test.go @@ -142,8 +142,7 @@ func TestGitlabPushPull(t *testing.T) { } // create repo backend - repo := repository.CreateGoGitTestRepo(false) - defer repository.CleanupTestRepos(repo) + repo := repository.CreateGoGitTestRepo(t, false) backend, err := cache.NewRepoCache(repo) require.NoError(t, err) @@ -215,8 +214,7 @@ func TestGitlabPushPull(t *testing.T) { fmt.Printf("test repository exported in %f seconds\n", time.Since(start).Seconds()) - repoTwo := repository.CreateGoGitTestRepo(false) - defer repository.CleanupTestRepos(repoTwo) + repoTwo := repository.CreateGoGitTestRepo(t, false) // create a second backend backendTwo, err := cache.NewRepoCache(repoTwo) diff --git a/bridge/gitlab/import_test.go b/bridge/gitlab/import_test.go index 1405e43b..676e8749 100644 --- a/bridge/gitlab/import_test.go +++ b/bridge/gitlab/import_test.go @@ -29,8 +29,7 @@ func TestGitlabImport(t *testing.T) { t.Skip("Env var GITLAB_PROJECT_ID missing") } - repo := repository.CreateGoGitTestRepo(false) - defer repository.CleanupTestRepos(repo) + repo := repository.CreateGoGitTestRepo(t, false) backend, err := cache.NewRepoCache(repo) require.NoError(t, err) |