gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: enable fast-restart of test-audi


From: gnunet
Subject: [taler-exchange] branch master updated: enable fast-restart of test-auditor
Date: Tue, 09 Apr 2024 17:02:28 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new f724ff6f0 enable fast-restart of test-auditor
f724ff6f0 is described below

commit f724ff6f0129b06108c986c27be64c2b5cae73c9
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Apr 9 17:02:15 2024 +0200

    enable fast-restart of test-auditor
---
 src/auditor/generate-auditor-basedb.sh |  1 -
 src/auditor/test-auditor.sh            | 45 ++++++++++++++++++++++------------
 2 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/src/auditor/generate-auditor-basedb.sh 
b/src/auditor/generate-auditor-basedb.sh
index 65aae3134..bbce37cdc 100755
--- a/src/auditor/generate-auditor-basedb.sh
+++ b/src/auditor/generate-auditor-basedb.sh
@@ -119,7 +119,6 @@ taler-wallet-cli \
 echo " DONE"
 
 taler-wallet-cli --wallet-db="$WALLET_DB" run-until-done
-taler-wallet-cli --wallet-db="$WALLET_DB" advanced run-pending
 
 # Dump database
 mkdir -p "$(dirname "$BASEDB")"
diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh
index ea8637cfa..67bc54e5a 100755
--- a/src/auditor/test-auditor.sh
+++ b/src/auditor/test-auditor.sh
@@ -2211,32 +2211,45 @@ grep -v host \
      > "$TMPDIR/pg_hba.conf.new"
 mv "$TMPDIR/pg_hba.conf.new" "$TMPDIR/pg_hba.conf"
 "${POSTGRES_PATH}/pg_ctl" \
-                -D "$TMPDIR" \
-                -l "${MY_TMP_DIR}/postgres.log" \
-                start \
-                > "${MY_TMP_DIR}/postgres-start.log" \
-                2> "${MY_TMP_DIR}/postgres-start.err"
+    -D "$TMPDIR" \
+    -l "${MY_TMP_DIR}/postgres.log" \
+    start \
+    > "${MY_TMP_DIR}/postgres-start.log" \
+    2> "${MY_TMP_DIR}/postgres-start.err"
 echo " DONE"
 PGHOST="$TMPDIR/sockets"
 export PGHOST
 MYDIR="${MY_TMP_DIR}/basedb"
 mkdir -p "${MYDIR}"
-echo "Generating fresh database at $MYDIR"
 
-if faketime -f '-1 d' ./generate-auditor-basedb.sh -d "$MYDIR/$DB"
+if [ -z $REUSE_BASEDB_DIR ]
 then
-    echo -n "Reset 'auditor-basedb' database at $PGHOST ..."
-    dropdb "auditor-basedb" >/dev/null 2>/dev/null || true
-    createdb "auditor-basedb" || exit_skip "Could not create database 
'$BASEDB' at $PGHOST"
-    echo " DONE"
-    check_with_database "$MYDIR/$DB"
-    if [ "$fail" != "0" ]
+    echo "Generating fresh database at $MYDIR"
+
+    if faketime -f '-1 d' ./generate-auditor-basedb.sh -d "$MYDIR/$DB"
     then
-        exit "$fail"
+        echo -n "Reset 'auditor-basedb' database at $PGHOST ..."
+        dropdb "auditor-basedb" >/dev/null 2>/dev/null || true
+        createdb "auditor-basedb" || exit_skip "Could not create database 
'$BASEDB' at $PGHOST"
+        echo " DONE"
+    else
+        echo "Generation failed"
+        exit 1
     fi
 else
-    echo "Generation failed"
-    exit 1
+    echo "Reusing existing database from ${REUSE_BASEDB_DIR}"
+    cp -r "${REUSE_BASEDB_DIR}/basedb"/* "${MYDIR}/"
+fi
+
+check_with_database "$MYDIR/$DB"
+if [ "$fail" != "0" ]
+then
+    exit "$fail"
+fi
+
+if [ -z $REUSE_BASEDB_DIR ]
+then
+    echo "Run 'export REUSE_BASEDB_DIR=${MY_TMP_DIR}' to re-run tests against 
the same database"
 fi
 
 exit 0

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