aboutsummaryrefslogtreecommitdiffstats
path: root/internal/repositories
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2024-03-11 20:42:20 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2024-03-11 20:42:20 -0400
commit95423212626f490b8c6434b420a4cd567110f41a (patch)
treedcaf53d9ec06e1a3ca8f3ff37787d9feb4ccba4b /internal/repositories
parentUpdate readme config reference (diff)
downloadcli-95423212626f490b8c6434b420a4cd567110f41a.zip
Tweak table cleanup logic for tests
Diffstat (limited to 'internal/repositories')
-rw-r--r--internal/repositories/migration_db_repo_test.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/internal/repositories/migration_db_repo_test.go b/internal/repositories/migration_db_repo_test.go
index 9c5d824..37efe37 100644
--- a/internal/repositories/migration_db_repo_test.go
+++ b/internal/repositories/migration_db_repo_test.go
@@ -121,10 +121,6 @@ func TestApply(t *testing.T) {
testdb := bolttest.NewTestDB(t)
repo, err := repositories.NewMigrationDBRepo(testdb)
assert.Nil(t, err)
- t.Cleanup(func() {
- bolttest.DropTable(t, testdb, "tmp")
- })
- bolttest.DropTable(t, testdb, "tmp")
migration := models.NewTimestampMigration(time.Now(), "test")
err = repo.Apply(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`, migration)
@@ -166,9 +162,6 @@ func TestApplyWithTx_SuccessfullyApplied(t *testing.T) {
testdb := bolttest.NewTestDB(t)
repo, err := repositories.NewMigrationDBRepo(testdb)
assert.Nil(t, err)
- t.Cleanup(func() {
- bolttest.DropTable(t, testdb, "tmp")
- })
migration := models.NewTimestampMigration(time.Now(), "test")
err = repo.ApplyWithTx(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`, migration)
@@ -187,9 +180,6 @@ func TestRevert(t *testing.T) {
testdb := bolttest.NewTestDB(t)
repo, err := repositories.NewMigrationDBRepo(testdb)
assert.Nil(t, err)
- t.Cleanup(func() {
- bolttest.DropTable(t, testdb, "tmp")
- })
_, err = testdb.Exec(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`)
assert.Nil(t, err)
@@ -242,10 +232,6 @@ func TestRevertWithTx_SuccessfullyReverted(t *testing.T) {
testdb := bolttest.NewTestDB(t)
repo, err := repositories.NewMigrationDBRepo(testdb)
assert.Nil(t, err)
- t.Cleanup(func() {
- bolttest.DropTable(t, testdb, "tmp")
- })
- bolttest.DropTable(t, testdb, "tmp")
_, err = testdb.Exec(`CREATE TABLE tmp(id INT NOT NULL PRIMARY KEY)`)
assert.Nil(t, err)