Refactor test scripts into scripts/ directory and improve CI

- Move run_tests_no_ot.sh and run_tests_with_ot.sh to scripts/ directory
- Create scripts/run_tests_with_coverage.py for coverage measurement
- Update CI to use scripts from scripts/ directory
- Eliminate code duplication between shell scripts and CI configuration
- Use Python script with coverage run for proper coverage measurement
This commit is contained in:
Oliver Falk
2025-10-16 17:58:33 +02:00
parent b5186f2081
commit 6f205ccad9
4 changed files with 115 additions and 2 deletions

30
scripts/run_tests_no_ot.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Run tests without OpenTelemetry enabled (default mode)
# This is the default test mode for most users
set -e
echo "Running tests without OpenTelemetry (default mode)..."
echo "====================================================="
# Ensure OpenTelemetry is disabled
export ENABLE_OPENTELEMETRY=false
export OTEL_ENABLED=false
# Run Django tests excluding OpenTelemetry-specific tests
python3 manage.py test \
ivatar.ivataraccount.test_auth \
ivatar.ivataraccount.test_views \
ivatar.ivataraccount.test_views_bluesky \
ivatar.test_auxiliary \
ivatar.test_file_security \
ivatar.test_static_pages \
ivatar.test_utils \
ivatar.test_views \
ivatar.test_views_stats \
ivatar.tools.test_views \
ivatar.test_wsgi \
-v2
echo ""
echo "Tests completed successfully (OpenTelemetry disabled)"