diff --git a/README.md b/README.md index 6dc3200..7fbc291 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ For local development, use the provided script to skip Bluesky tests that require external API credentials: ```bash -./run_tests_local.sh +./scripts/run_tests_local.sh ``` This runs all tests except those marked with `@pytest.mark.bluesky`. diff --git a/scripts/run_tests_local.sh b/scripts/run_tests_local.sh new file mode 100755 index 0000000..f662bfe --- /dev/null +++ b/scripts/run_tests_local.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Run tests locally, skipping Bluesky tests that require external API credentials +# OpenTelemetry is disabled by default for local testing + +echo "Running tests locally (skipping Bluesky tests, OpenTelemetry disabled)..." +echo "=======================================================================" + +# Ensure OpenTelemetry is disabled for local testing +export ENABLE_OPENTELEMETRY=false +export OTEL_ENABLED=false + +# Run Django tests excluding the Bluesky test file and OpenTelemetry tests +python3 manage.py test \ + ivatar.ivataraccount.test_auth \ + ivatar.ivataraccount.test_views \ + 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 "To run all tests including Bluesky (requires API credentials):" +echo "python3 manage.py test -v2" +echo "" +echo "To run only Bluesky tests:" +echo "python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v2" +echo "" +echo "To run tests with OpenTelemetry enabled:" +echo "./run_tests_with_ot.sh" +echo "" +echo "To run tests without OpenTelemetry (default):" +echo "./run_tests_no_ot.sh" diff --git a/scripts/run_tests_no_ot.sh b/scripts/run_tests_no_ot.sh index 4720101..3447c52 100755 --- a/scripts/run_tests_no_ot.sh +++ b/scripts/run_tests_no_ot.sh @@ -11,20 +11,8 @@ echo "=====================================================" 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 +# Run Django tests (Django will auto-discover all tests) +python3 manage.py test -v2 echo "" echo "Tests completed successfully (OpenTelemetry disabled)" diff --git a/scripts/run_tests_with_coverage.py b/scripts/run_tests_with_coverage.py index a5f3ed9..e4d0efe 100755 --- a/scripts/run_tests_with_coverage.py +++ b/scripts/run_tests_with_coverage.py @@ -18,24 +18,8 @@ def main(): print("Running tests with OpenTelemetry enabled...") print("==========================================") - # Test modules to run (including OpenTelemetry-specific tests) - test_modules = [ - 'ivatar.ivataraccount.test_auth', - 'ivatar.ivataraccount.test_views', - 'ivatar.ivataraccount.test_views_bluesky', - 'ivatar.test_auxiliary', - 'ivatar.test_file_security', - 'ivatar.test_opentelemetry', - 'ivatar.test_static_pages', - 'ivatar.test_utils', - 'ivatar.test_views', - 'ivatar.test_views_stats', - 'ivatar.tools.test_views', - 'ivatar.test_wsgi', - ] - - # Run Django tests - cmd = ['python3', 'manage.py', 'test'] + test_modules + ['-v2'] + # Run Django tests (Django will auto-discover all tests) + cmd = ['python3', 'manage.py', 'test', '-v2'] try: result = subprocess.run(cmd, check=True) diff --git a/scripts/run_tests_with_ot.sh b/scripts/run_tests_with_ot.sh index 63de521..a428c72 100755 --- a/scripts/run_tests_with_ot.sh +++ b/scripts/run_tests_with_ot.sh @@ -13,21 +13,8 @@ export OTEL_ENABLED=true export OTEL_SERVICE_NAME=ivatar-test export OTEL_ENVIRONMENT=test -# Run Django tests including 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_opentelemetry \ - ivatar.test_static_pages \ - ivatar.test_utils \ - ivatar.test_views \ - ivatar.test_views_stats \ - ivatar.tools.test_views \ - ivatar.test_wsgi \ - -v2 +# Run Django tests (Django will auto-discover all tests) +python3 manage.py test -v2 echo "" echo "Tests completed successfully (OpenTelemetry enabled)"