mit einem Klick
run-tests
// Run dojo tests, analyze failures, and debug issues. Use when testing code changes, running pytest, verifying fixes, or debugging test failures.
// Run dojo tests, analyze failures, and debug issues. Use when testing code changes, running pytest, verifying fixes, or debugging test failures.
| name | run-tests |
| description | Run dojo tests, analyze failures, and debug issues. Use when testing code changes, running pytest, verifying fixes, or debugging test failures. |
Tests take ~10 minutes to run, so run them as a background process.
Start tests in background:
./deploy.sh -b -t 2>&1 | tee /tmp/test.log &
Monitor progress:
tail -f /tmp/test.log
To run only specific test files quickly, edit deploy.sh line:
test_container pytest --order-dependencies --timeout=60 -v . "$@"
Change it to run a specific file:
test_container pytest --order-dependencies --timeout=60 -v test_belts.py "$@"
Then run:
./deploy.sh -b -t 2>&1 | tee /tmp/test.log &
Important: After specific tests pass, restore the original line and rerun ALL tests.
After tests complete, analyze /tmp/test.log:
FAILED to find failing testsERROR to find errors/tmp/test.log for FAILED/ERRORdocker exec $(basename "$PWD") docker logs ctfd 2>&1 | tail -100
You can also look at all any of the containers inside of docker exec $(basename "$PWD"), the whole list including names is in docker-compose.yml.# Start all tests (background)
./deploy.sh -b -t 2>&1 | tee /tmp/test.log &
# Check if tests are still running
jobs
# View test output
cat /tmp/test.log
# Search for failures
grep -E "(FAILED|ERROR|error)" /tmp/test.log
# View CTFd logs for debugging
docker exec $(basename "$PWD") docker logs ctfd 2>&1 | tail -200
# Run DB queries for debugging
docker exec -i $(basename "$PWD") dojo db
After all singlenode tests pass, run multinode tests to verify the full cluster setup:
./deploy.sh -b -M -t 2>&1 | tee /tmp/test-multinode.log &
Monitor progress:
tail -f /tmp/test-multinode.log
Multinode mode starts 3 containers (1 main + 2 workspace nodes) and tests the distributed architecture. Some things that only run on the main node (like stats-worker) need special handling in multinode.
ALWAYS rerun all singlenode tests before declaring everything passed. Fixing one test can break others.
After singlenode tests pass, run multinode tests (-M flag) to verify the full cluster setup works correctly.