gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] 01/02: Testing harness.


From: gnunet
Subject: [libeufin] 01/02: Testing harness.
Date: Thu, 10 Dec 2020 15:54:47 +0100

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

ms pushed a commit to branch master
in repository libeufin.

commit bbe99c48419ee0bf75ee07e95fcc176733dbca68
Author: MS <ms@taler.net>
AuthorDate: Thu Dec 10 15:28:17 2020 +0100

    Testing harness.
    
    Prefer commands offered by Nexus and Sandbox to
    drop their tables, as opposed to a direct shell-based
    way of deleting rows.
---
 integration-tests/tests.py | 15 ++++++++-------
 integration-tests/util.py  | 26 ++++++++++++++++----------
 2 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py
index 011a39b..9ffaf6a 100755
--- a/integration-tests/tests.py
+++ b/integration-tests/tests.py
@@ -10,10 +10,9 @@ from util import (
     startNexus,
     startSandbox,
     assertResponse,
-    flushTablesSandbox,
-    flushTablesNexus,
     makeNexusSuperuser,
-    removeStaleTables
+    dropSandboxTables,
+    dropNexusTables
 )
 
 # Base URLs
@@ -134,17 +133,19 @@ def prepareNexus():
         )
     )
 
-removeStaleTables(DB)
-startNexus(DB)
+dropSandboxTables(DB)
 startSandbox(DB)
+dropNexusTables(DB)
+startNexus(DB)
 
 def setup_function():
     prepareSandbox()
     prepareNexus()
 
+
 def teardown_function():
-  flushTablesNexus(DB)
-  flushTablesSandbox(DB)
+  dropSandboxTables(DB)
+  dropNexusTables(DB)
 
 
 def test_env():
diff --git a/integration-tests/util.py b/integration-tests/util.py
index 6e96c45..a4c053d 100644
--- a/integration-tests/util.py
+++ b/integration-tests/util.py
@@ -59,19 +59,25 @@ def makeNexusSuperuser(dbName):
         f"--args=superuser admin --password x --db-name={dbName}",
     ])
 
-def drop_public_schema(dbName):
+def dropSandboxTables(dbName):
     check_call([
-        "psql",
-        "-d", dbName, "-q",
-        "-h", "127.0.0.1", "-p", "5433",
-        "-U", "libeufin",
-        "-c", "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
+        "../gradlew",
+        "-q", "--console=plain",
+        "-p", "..",
+        "sandbox:run",
+        f"--args=drop-tables --db-name={dbName}",
+    ])
+
+
+def dropNexusTables(dbName):
+    check_call([
+        "../gradlew",
+        "-q", "--console=plain",
+        "-p", "..",
+        "nexus:run",
+        f"--args=drop-tables --db-name={dbName}",
     ])
-def flushTablesSandbox(dbName):
-    drop_public_schema(dbName)
 
-def flushTablesNexus(dbName):
-    drop_public_schema(dbName)
 
 def startSandbox(dbName):
     check_call(["../gradlew", "-q", "--console=plain", "-p", "..", 
"sandbox:assemble"])

-- 
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]