mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(FastAPI): run test_initdb.py ahead of time in docker
In some cases, when tests fail through Docker, the database ends up in an invalid state. This causes subsequent runs to error out with non-sensical DB errors. The `test_initdb.py` test suite runs tests which setup every modifiable table in the database, so let's just run it first here to avoid any invalid test DB state. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
50634d30b3
commit
7b7e571e93
1 changed files with 5 additions and 0 deletions
|
@ -26,6 +26,11 @@ done
|
||||||
python -m aurweb.initdb 2>/dev/null || \
|
python -m aurweb.initdb 2>/dev/null || \
|
||||||
(echo "Error: aurweb.initdb failed; already initialized?" && /bin/true)
|
(echo "Error: aurweb.initdb failed; already initialized?" && /bin/true)
|
||||||
|
|
||||||
|
# Run test_initdb ahead of time, which clears out the database,
|
||||||
|
# in case of previous failures which stopped the test suite before
|
||||||
|
# finishing the ends of some test fixtures.
|
||||||
|
eatmydata -- pytest test/test_initdb.py
|
||||||
|
|
||||||
# Run pytest with optional targets in front of it.
|
# Run pytest with optional targets in front of it.
|
||||||
eatmydata -- make -C test "${PARAMS[@]}" pytest
|
eatmydata -- make -C test "${PARAMS[@]}" pytest
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue