diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-10 20:15:04 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2024-03-10 20:15:04 -0400 |
| commit | 62bacfb34dbea7ca88e22879a8d1699c79d58f97 (patch) | |
| tree | 8b950c422d04866d9dd3681e0e595f9e16c4ea0e | |
| parent | Attempt to fix a couple flaky tests (diff) | |
| download | cli-62bacfb34dbea7ca88e22879a8d1699c79d58f97.zip | |
Tweak tests
| -rw-r--r-- | internal/repositories/migration_db_repo_test.go | 1 | ||||
| -rw-r--r-- | internal/storage/db_test.go | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/internal/repositories/migration_db_repo_test.go b/internal/repositories/migration_db_repo_test.go index d54fb24..2a316c9 100644 --- a/internal/repositories/migration_db_repo_test.go +++ b/internal/repositories/migration_db_repo_test.go @@ -124,6 +124,7 @@ func TestApply(t *testing.T) { 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) diff --git a/internal/storage/db_test.go b/internal/storage/db_test.go index 949ab52..4b7dc93 100644 --- a/internal/storage/db_test.go +++ b/internal/storage/db_test.go @@ -114,6 +114,7 @@ func TestTx_Commit(t *testing.T) { bolttest.DropTable(t, db, "tmp") assert.Nil(t, db.Close()) }) + bolttest.DropTable(t, db, "tmp") err = db.Tx(func(db storage.DB) error { _, err = db.Exec(`CREATE TABLE tmp(id int primary key);`) @@ -135,6 +136,7 @@ func TestTx_Rollback(t *testing.T) { bolttest.DropTable(t, db, "tmp") assert.Nil(t, db.Close()) }) + bolttest.DropTable(t, db, "tmp") _, err = db.Exec(`CREATE TABLE tmp(id INT PRIMARY KEY);`) assert.Nil(t, err) expectedErr := errors.New("error!") |