Skip to content

Commit 3ccaeeb

Browse files
committed
Skip DB teardown when --leave-db-running option specified
Closes #45
1 parent 2147c88 commit 3ccaeeb

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/tarantool/counter.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
(assoc op :type :ok :value value))))))
4949

5050
(teardown! [_ test]
51-
(cl/with-conn-failure-retry conn
52-
(j/execute! conn [(str "DROP TABLE IF EXISTS " table-name)])))
51+
(when-not (:leave-db-running? test)
52+
(cl/with-conn-failure-retry conn
53+
(j/execute! conn [(str "DROP TABLE IF EXISTS " table-name)]))))
5354

5455
(close! [_ test]))
5556

src/tarantool/register.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@
7474
(assoc op :type :fail)))))))
7575

7676
(teardown! [_ test]
77-
(cl/with-conn-failure-retry conn
78-
(j/execute! conn [(str "DROP TABLE IF EXISTS " table-name)])))
77+
(when-not (:leave-db-running? test)
78+
(cl/with-conn-failure-retry conn
79+
(j/execute! conn [(str "DROP TABLE IF EXISTS " table-name)]))))
7980

8081
(close! [_ test]))
8182

src/tarantool/sets.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
(assoc op :type :ok, :value)))))))
4646

4747
(teardown! [_ test]
48-
(cl/with-conn-failure-retry conn
49-
(j/execute! conn [(str "DROP TABLE IF EXISTS " table-name)])))
48+
(when-not (:leave-db-running? test)
49+
(cl/with-conn-failure-retry conn
50+
(j/execute! conn [(str "DROP TABLE IF EXISTS " table-name)]))))
5051

5152
(close! [_ test]))
5253

0 commit comments

Comments
 (0)