Skip to content

Commit e274d29

Browse files
authored
Unit Testing: Do no run in debug mode in order to reduce logging (#13241)
* Unit Testing: Do no run in debug mode in order to reduce logging Viewing a failed test in the GHA logs is not very helpful without rendering the raw view because there are 50k+ lines of debug logs. Reducing the logging verbosity would make the tests quite a bit faster as well as finding failures easier in the GHA UI * Remove verbosity from unit test commands
1 parent 7781201 commit e274d29

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docker-compose.override.unit_tests_cicd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
condition: service_started
1414
environment:
1515
PYTHONWARNINGS: error # We are strict about Warnings during testing
16-
DD_DEBUG: 'True'
16+
DD_DEBUG: 'False'
1717
DD_LOG_LEVEL: 'ERROR'
1818
DD_TEST_DATABASE_NAME: ${DD_TEST_DATABASE_NAME:-test_defectdojo}
1919
DD_DATABASE_NAME: ${DD_TEST_DATABASE_NAME:-test_defectdojo}

docker/entrypoint-unit-tests.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,16 @@ echo "Unit Tests"
8080
echo "------------------------------------------------------------"
8181

8282
# Removing parallel and shuffle for now to maintain stability
83-
python3 manage.py test unittests -v 3 --keepdb --no-input --exclude-tag="non-parallel" --exclude-tag="transactional" || {
83+
python3 manage.py test unittests --keepdb --no-input --exclude-tag="non-parallel" --exclude-tag="transactional" || {
8484
exit 1;
8585
}
86-
python3 manage.py test unittests -v 3 --keepdb --no-input --tag="non-parallel" || {
86+
python3 manage.py test unittests --keepdb --no-input --tag="non-parallel" || {
8787
exit 1;
8888
}
8989
# Running one unit tests that inherits from TransactionTestCase somehow changes the behaviour of how Django loads fixtures into the database.
9090
# Meaning any test after this one would fail to load our dojo_testdata.json fixture. In a way this makes sense as it contains some data integrity problems.
9191
# I tried to fix these in https://github.com/DefectDojo/django-DefectDojo/pull/13217.
9292
# For now here we run the only TranscationTestCase at the end to avoid the problem.
93-
python3 manage.py test unittests -v 3 --keepdb --no-input --tag="transactional" || {
93+
python3 manage.py test unittests --keepdb --no-input --tag="transactional" || {
9494
exit 1;
9595
}

0 commit comments

Comments
 (0)