mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
change(logging): restrict logging.conf & add logging.test.conf
We'll override logging.conf with logging.test.conf for debug logging needed for tests now, so we can rely on the default logging.conf for production use. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
cce9385fb1
commit
bf4662e26f
4 changed files with 11 additions and 13 deletions
|
@ -26,15 +26,13 @@ test:
|
|||
- cp -v conf/config.dev conf/config
|
||||
- sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
||||
- ./docker/test-mysql-entrypoint.sh # Create mysql AUR_CONFIG.
|
||||
- make -C po all install
|
||||
- make -C doc
|
||||
- make -C test clean
|
||||
- cp -vf logging.test.conf logging.conf # Put test logging config in place.
|
||||
- make -C po all install # Compile translations.
|
||||
- make -C doc # Compile asciidoc.
|
||||
- make -C test clean # Cleanup coverage.
|
||||
script:
|
||||
# Run sharness.
|
||||
- cp logging.conf logging.conf.bak # Copy devel logging.conf to backup
|
||||
- cp logging.prod.conf logging.conf # Copy in logging.prod.conf
|
||||
- make -C test sh # sharness tests use sqlite.
|
||||
- cp logging.conf.bak logging.conf # Restore devel logging.conf
|
||||
# Run pytest.
|
||||
- pytest # Run pytest suites.
|
||||
- make -C test coverage # Produce coverage reports.
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#!/bin/bash
|
||||
set -eou pipefail
|
||||
|
||||
# Set test logging.
|
||||
cp -vf "logging.test.conf" "logging.conf"
|
||||
|
||||
# We use the root user for testing in Docker.
|
||||
# The test user must be able to create databases and drop them.
|
||||
aurweb-config set database user 'root'
|
||||
|
|
|
@ -14,9 +14,7 @@ handlers=
|
|||
propogate=0
|
||||
|
||||
[logger_aurweb]
|
||||
; This loglevel is set to DEBUG for tests where we expect specific
|
||||
; debug logging to occur. In production, this should be set to INFO.
|
||||
level=DEBUG
|
||||
level=INFO
|
||||
handlers=simpleHandler
|
||||
qualname=aurweb
|
||||
propagate=1
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
; This logger should be used in production, as it limits the logging
|
||||
; done to INFO. The main logger uses DEBUG and is purely meant for
|
||||
; debugging and unit tests.
|
||||
[loggers]
|
||||
keys=root,aurweb,uvicorn,hypercorn,alembic
|
||||
|
||||
|
@ -17,7 +14,9 @@ handlers=
|
|||
propogate=0
|
||||
|
||||
[logger_aurweb]
|
||||
level=INFO
|
||||
; This loglevel is set to DEBUG for tests where we expect specific
|
||||
; debug logging to occur. In production, this should be set to INFO.
|
||||
level=DEBUG
|
||||
handlers=simpleHandler
|
||||
qualname=aurweb
|
||||
propagate=1
|
Loading…
Add table
Reference in a new issue