gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: move (unit) test DB under /tmp


From: gnunet
Subject: [libeufin] branch master updated: move (unit) test DB under /tmp
Date: Thu, 10 Dec 2020 17:37:18 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new d4a41ce  move (unit) test DB under /tmp
d4a41ce is described below

commit d4a41ce0aa59b7b599c927c1d1d507cbb075a38d
Author: MS <ms@taler.net>
AuthorDate: Thu Dec 10 17:37:03 2020 +0100

    move (unit) test DB under /tmp
---
 nexus/src/test/kotlin/DBTest.kt   | 3 ++-
 sandbox/src/test/kotlin/DBTest.kt | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/nexus/src/test/kotlin/DBTest.kt b/nexus/src/test/kotlin/DBTest.kt
index 8ca5956..26899bf 100644
--- a/nexus/src/test/kotlin/DBTest.kt
+++ b/nexus/src/test/kotlin/DBTest.kt
@@ -11,13 +11,14 @@ import java.io.File
  * Cleans up the DB file afterwards.
  */
 fun withTestDatabase(f: () -> Unit) {
-    val dbfile = "nexus-test.sqlite3"
+    val dbfile = "jdbc:sqlite:/tmp/nexus-test.sqlite3"
     File(dbfile).also {
         if (it.exists()) {
             it.delete()
         }
     }
     Database.connect("jdbc:sqlite:$dbfile")
+    dbDropTables(dbfile)
     try {
         f()
     }
diff --git a/sandbox/src/test/kotlin/DBTest.kt 
b/sandbox/src/test/kotlin/DBTest.kt
index e333e87..aecccfa 100644
--- a/sandbox/src/test/kotlin/DBTest.kt
+++ b/sandbox/src/test/kotlin/DBTest.kt
@@ -23,6 +23,7 @@ import org.jetbrains.exposed.sql.transactions.transaction
 import org.junit.Test
 import tech.libeufin.sandbox.BankAccountTransactionsTable
 import tech.libeufin.sandbox.BankAccountsTable
+import tech.libeufin.sandbox.dbDropTables
 import tech.libeufin.util.millis
 import tech.libeufin.util.parseDashedDate
 import java.io.File
@@ -33,13 +34,14 @@ import java.time.LocalDateTime
  * Cleans up the DB file afterwards.
  */
 fun withTestDatabase(f: () -> Unit) {
-    val dbfile = "jdbc:sqlite:nexus-test.sqlite3"
+    val dbfile = "jdbc:sqlite:/tmp/nexus-test.sqlite3"
     File(dbfile).also {
         if (it.exists()) {
             it.delete()
         }
     }
     Database.connect("$dbfile")
+    dbDropTables(dbfile)
     try {
         f()
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]