Skip to content

Commit

Permalink
Rest Framework Tests: Improve speed and repeatability (#10503)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maffooch authored Jul 8, 2024
1 parent 3e096e1 commit cf864b1
Show file tree
Hide file tree
Showing 24 changed files with 308 additions and 221 deletions.
1 change: 1 addition & 0 deletions docker-compose.override.unit_tests_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
environment:
PYTHONWARNINGS: error # We are strict about Warnings during testing
DD_DEBUG: 'True'
DD_LOG_LEVEL: 'ERROR'
DD_TEST_DATABASE_NAME: ${DD_TEST_DATABASE_NAME}
DD_DATABASE_NAME: ${DD_TEST_DATABASE_NAME}
DD_DATABASE_ENGINE: ${DD_DATABASE_ENGINE}
Expand Down
3 changes: 2 additions & 1 deletion docker/entrypoint-unit-tests-devDocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ EOF

echo "Unit Tests"
echo "------------------------------------------------------------"
python3 manage.py test unittests -v 3 --keepdb --no-input --shuffle
python3 manage.py test unittests -v 3 --keepdb --no-input --failfast --shuffle --parallel --exclude-tag="non-parallel"
python3 manage.py test unittests -v 3 --keepdb --no-input --failfast --shuffle --tag="non-parallel"

# you can select a single file to "test" unit tests
# python3 manage.py test unittests.tools.test_npm_audit_scan_parser.TestNpmAuditParser --keepdb -v 3
Expand Down
4 changes: 3 additions & 1 deletion docker/entrypoint-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ python3 manage.py migrate

echo "Unit Tests"
echo "------------------------------------------------------------"
python3 manage.py test unittests -v 3 --keepdb --no-input --shuffle
python3 manage.py test unittests -v 3 --keepdb --no-input --failfast --shuffle --parallel --exclude-tag="non-parallel"
python3 manage.py test unittests -v 3 --keepdb --no-input --failfast --shuffle --tag="non-parallel"

Loading

0 comments on commit cf864b1

Please sign in to comment.