[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] branch master updated: test launcher against d
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] branch master updated: test launcher against db not found, plus being nice with small screens. |
Date: |
Sat, 23 Dec 2017 12:48:23 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository bank.
The following commit(s) were added to refs/heads/master by this push:
new 88bef48 test launcher against db not found, plus being nice with
small screens.
88bef48 is described below
commit 88bef48c1e5dc04d28f4bc26a42dadb27686bec0
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Dec 23 12:47:31 2017 +0100
test launcher against db not found, plus being
nice with small screens.
---
Makefile.am | 77 +++++++++++++++++++++++++++++++++++-------
bank-check-alt-dbnotfound.conf | 17 ++++++++++
taler-bank-manage.in | 1 +
3 files changed, 82 insertions(+), 13 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 6437b4a..7085a44 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,26 +31,77 @@ install-dev:
@$(PYTHON) ./install-dev.py
env:
- @export DJANGO_SETTINGS_MODULE="talerbank.settings"
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check.conf" && bash
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings" \
+ TALER_PREFIX="@prefix@" \
+ TALER_CONFIG_FILE="bank-check.conf" && bash
+FMT="\n\n%s\n%s\n"
+SEPARATOR=`printf "%s%s" \
+ "----------------------------------------------" \
+ "------------------------"`
+
check:
- @export DJANGO_SETTINGS_MODULE="talerbank.settings"
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check.conf" && python3 -m
django test --no-input talerbank.app.tests
- @printf --
"\n\n----------------------------------------------------------------------\nTesting
against non existent config file\n\n"
- @export DJANGO_SETTINGS_MODULE="talerbank.settings"
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="non-existent.conf" && python3 -m
django test --no-input talerbank.app.tests ; test 3 = $$?
- @printf --
"\n\n----------------------------------------------------------------------\nTesting
against bad db string\n\n"
- @export DJANGO_SETTINGS_MODULE="talerbank.settings"
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check-alt-baddb.conf" &&
python3 -m django test --no-input
talerbank.app.tests_alt.BadDatabaseStringTestCase ; test 2 = $$?
- @printf --
"\n\n----------------------------------------------------------------------\nTesting
against bad amount\n\n"
- @export DJANGO_SETTINGS_MODULE="talerbank.settings"
TALER_PREFIX="@prefix@" TALER_CONFIG_FILE="bank-check-alt-badamount.conf" &&
python3 -m django test --no-input
talerbank.app.tests_alt.BadMaxDebtOptionTestCase
- @printf --
"\n\n----------------------------------------------------------------------\nTesting
against no currency in config\n\n"
- @export TALER_BASE_CONFIG="/tmp"
DJANGO_SETTINGS_MODULE="talerbank.settings" TALER_PREFIX="@prefix@"
TALER_CONFIG_FILE="bank-check-alt-nocurrency.conf" && python3 -m django test
--no-input talerbank.app.tests_alt.NoCurrencyOptionTestCase ; test 3 = $$?
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings" \
+ TALER_PREFIX="@prefix@" \
+ TALER_CONFIG_FILE="bank-check.conf" \
+ && python3 -m django test --no-input talerbank.app.tests
+ @printf ${FMT} ${SEPARATOR} \
+ "Testing against non existent config file"
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings" \
+ TALER_PREFIX="@prefix@" \
+ TALER_CONFIG_FILE="non-existent.conf" \
+ && python3 \
+ -m django test \
+ --no-input talerbank.app.tests ; \
+ test 3 = $$?
+ @printf ${FMT} ${SEPARATOR} \
+ "Testing against bad db string"
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings" \
+ TALER_PREFIX="@prefix@" \
+ TALER_CONFIG_FILE="bank-check-alt-baddb.conf" \
+ && python3 \
+ -m django test \
+ --no-input \
+ talerbank.app.tests_alt.BadDatabaseStringTestCase ; \
+ test 2 = $$?
+ @printf ${FMT} ${SEPARATOR} \
+ "Testing against bad amount"
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings" \
+ TALER_PREFIX="@prefix@" \
+ TALER_CONFIG_FILE="bank-check-alt-badamount.conf" \
+ && python3 \
+ -m django test \
+ --no-input \
+ talerbank.app.tests_alt.BadMaxDebtOptionTestCase
+ @printf ${FMT} ${SEPARATOR} \
+ "Testing against no currency in config"
+ @export TALER_BASE_CONFIG="/tmp" \
+ DJANGO_SETTINGS_MODULE="talerbank.settings" \
+ TALER_PREFIX="@prefix@" \
+ TALER_CONFIG_FILE="bank-check-alt-nocurrency.conf" \
+ && python3 \
+ -m django test \
+ --no-input \
+ talerbank.app.tests_alt.NoCurrencyOptionTestCase ; \
+ test 3 = $$?
+ @printf ${FMT} ${SEPARATOR} \
+ "Testing against db not found"
+ @export DJANGO_SETTINGS_MODULE="talerbank.settings" \
+ TALER_PREFIX="@prefix@" \
+ TALER_CONFIG_FILE="bank-check-alt-dbnotfound.conf" \
+ && python3 ./taler-bank-manage serve-uwsgi ; \
+ test 4 = $$?
# install into prefix
install-exec-hook:
- @pip3 install . --install-option="address@hidden@" @DEBIAN_PIP3_SYSTEM@
+ @pip3 install . --install-option="address@hidden@" \
+ @DEBIAN_PIP3_SYSTEM@
@# force update when sources changed
- @pip3 install . --install-option="address@hidden@" @DEBIAN_PIP3_SYSTEM@
--upgrade --no-deps
+ @pip3 install . --install-option="address@hidden@" \
+ @DEBIAN_PIP3_SYSTEM@ --upgrade --no-deps
pylint:
@pylint --load-plugins pylint_django talerbank/
app:
- @tar czf taler-bank-$(PACKAGE_VERSION)-app.tgz `cat INCLUDE.APP`
+ @tar czf taler-bank-$(PACKAGE_VERSION)-app.tgz \
+ `cat INCLUDE.APP`
diff --git a/bank-check-alt-dbnotfound.conf b/bank-check-alt-dbnotfound.conf
new file mode 100644
index 0000000..6c47d07
--- /dev/null
+++ b/bank-check-alt-dbnotfound.conf
@@ -0,0 +1,17 @@
+# Config file containing intentional errors, used
+# to test how the bank reacts.
+
+[taler]
+
+CURRENCY = KUDOS
+
+[bank]
+
+# Which database should we use?
+DATABASE = postgres:///idontexist
+
+# FIXME
+MAX_DEBT = KUDOS:50
+
+# FIXME
+MAX_DEBT_BANK = KUDOS:0
diff --git a/taler-bank-manage.in b/taler-bank-manage.in
index ca7a237..935c8d5 100644
--- a/taler-bank-manage.in
+++ b/taler-bank-manage.in
@@ -131,3 +131,4 @@ try:
ARGS.func(ARGS)
except django.db.utils.OperationalError:
LOGGER.error("Your database has serious problems. Does it exist?")
+ sys.exit(4)
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-bank] branch master updated: test launcher against db not found, plus being nice with small screens.,
gnunet <=