commit 6fb685d27a8d7251762e0591e5d3f0177b4ad810
parent 6f4969cbcd41ba7f8668d0f1a59975c78e1e6f72
Author: Özgür Kesim <oec-taler@kesim.org>
Date: Thu, 12 Dec 2024 22:47:13 +0100
[exchange] fix auditor tests in container
Multiple issues fixed:
- missing debian packages for auditor tests added to Containerfile:
faketime, libeufin-{common,nexus,bank}, taler-wallet-cli, taler-merchant
- missing TALER_*_PREFIX environment set prior to tests,
some /usr/local, some /usr (merchant from debian, f.e.).
- LD_LIBRARY_PATH adjusted for /usr/local and debian-merchant lib
- initdb step skipped in case of root user calling the test-scripts
Fixes #9380
Diffstat:
4 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/contrib/ci/jobs/002-test/1-build.sh b/contrib/ci/jobs/002-test/1-build.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -evux
+
+apt-get update
+apt-get upgrade -yqq
+
+./bootstrap
+./configure CFLAGS="-ggdb -O0" \
+ --enable-logging=verbose \
+ --disable-doc
+
+nump=$(grep processor /proc/cpuinfo | wc -l)
+make clean
+make -j$(( $nump / 2 ))
+cd src/templating/
+./run-original-tests.sh
+make clean
+cd -
+make -j$(( $nump / 2 ))
+
diff --git a/contrib/ci/jobs/002-test/2-install.sh b/contrib/ci/jobs/002-test/2-install.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+set -evux
+
+make install
diff --git a/contrib/ci/jobs/002-test/3-startdb.sh b/contrib/ci/jobs/002-test/3-startdb.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -evux
+
+export PGPORT=5432
+sudo -u postgres /usr/lib/postgresql/15/bin/pg_ctl \
+ start -D /etc/postgresql/15/main -o "-h localhost -p $PGPORT"
+sudo -u postgres createuser -p $PGPORT root -s -w
+sudo -u postgres createdb -p $PGPORT -O root talercheck
+
diff --git a/contrib/ci/jobs/002-test/4-test.sh b/contrib/ci/jobs/002-test/4-test.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -evux
+
+check_command()
+{
+ # /usr/local is where the install step has put the libararies
+ export TALER_EXCHANGE_PREFIX=/usr/local
+ export TALER_AUDITOR_PREFIX=/usr/local
+
+ # bank and merchant are from the debian package, having /usr as
+ # their installation path's
+ export TALER_BANK_PREFIX=/usr
+ export TALER_MERCHANT_PREFIX=/usr
+ export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/x86_64-linux-gnu/taler-merchant
+
+ make check
+}
+
+print_logs()
+{
+ set +e
+ for i in src/*/test-suite.log
+ do
+ echo "Printing ${i}"
+ cat "$i"
+ for FAILURE in $(grep '^FAIL:' ${i} | cut -d' ' -f2)
+ do
+ echo "Printing $(dirname $i)/${FAILURE}.log"
+ cat "$(dirname $i)/${FAILURE}.log"
+ done
+ done
+}
+
+if ! check_command ; then
+ print_logs
+ exit 1
+fi