Increase verbosity

This commit is contained in:
Oliver Falk
2025-10-16 20:18:12 +02:00
parent 69044a12e6
commit b4e10e3ec5
5 changed files with 14 additions and 10 deletions

View File

@@ -49,7 +49,7 @@ ivatar is a Django-based federated avatar service that serves as an alternative
### Testing ### Testing
- **MANDATORY: Run pre-commit hooks and tests before any changes** - this is an obligation - **MANDATORY: Run pre-commit hooks and tests before any changes** - this is an obligation
- Use `./run_tests_local.sh` for local development (skips Bluesky tests requiring API credentials) - Use `./run_tests_local.sh` for local development (skips Bluesky tests requiring API credentials)
- Run `python3 manage.py test -v2` for full test suite including Bluesky tests - Run `python3 manage.py test -v3` for full test suite including Bluesky tests
- **MANDATORY: When adding new code, always write tests to increase code coverage** - never decrease coverage - **MANDATORY: When adding new code, always write tests to increase code coverage** - never decrease coverage
- Use pytest markers appropriately: - Use pytest markers appropriately:
- `@pytest.mark.bluesky`: Tests requiring Bluesky API credentials - `@pytest.mark.bluesky`: Tests requiring Bluesky API credentials

View File

@@ -15,6 +15,7 @@
## Running Tests ## Running Tests
### Local Development (Recommended) ### Local Development (Recommended)
For local development, use the provided script to skip Bluesky tests that require external API credentials: For local development, use the provided script to skip Bluesky tests that require external API credentials:
```bash ```bash
@@ -24,27 +25,30 @@ For local development, use the provided script to skip Bluesky tests that requir
This runs all tests except those marked with `@pytest.mark.bluesky`. This runs all tests except those marked with `@pytest.mark.bluesky`.
### All Tests ### All Tests
To run all tests including Bluesky tests (requires Bluesky API credentials): To run all tests including Bluesky tests (requires Bluesky API credentials):
```bash ```bash
python3 manage.py test -v2 python3 manage.py test -v3
``` ```
### Specific Test Categories ### Specific Test Categories
```bash ```bash
# Run only Bluesky tests # Run only Bluesky tests
python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v2 python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v3
# Run only file upload security tests # Run only file upload security tests
python3 manage.py test ivatar.test_file_security -v2 python3 manage.py test ivatar.test_file_security -v3
# Run only upload tests # Run only upload tests
python3 manage.py test ivatar.ivataraccount.test_views -v2 python3 manage.py test ivatar.ivataraccount.test_views -v3
``` ```
## Test Markers ## Test Markers
Tests are categorized using pytest markers: Tests are categorized using pytest markers:
- `@pytest.mark.bluesky`: Tests requiring Bluesky API credentials - `@pytest.mark.bluesky`: Tests requiring Bluesky API credentials
- `@pytest.mark.slow`: Long-running tests - `@pytest.mark.slow`: Long-running tests
- `@pytest.mark.integration`: Integration tests - `@pytest.mark.integration`: Integration tests

View File

@@ -21,14 +21,14 @@ python3 manage.py test \
ivatar.test_views_stats \ ivatar.test_views_stats \
ivatar.tools.test_views \ ivatar.tools.test_views \
ivatar.test_wsgi \ ivatar.test_wsgi \
-v2 -v3
echo "" echo ""
echo "To run all tests including Bluesky (requires API credentials):" echo "To run all tests including Bluesky (requires API credentials):"
echo "python3 manage.py test -v2" echo "python3 manage.py test -v3"
echo "" echo ""
echo "To run only Bluesky tests:" echo "To run only Bluesky tests:"
echo "python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v2" echo "python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v3"
echo "" echo ""
echo "To run tests with OpenTelemetry enabled:" echo "To run tests with OpenTelemetry enabled:"
echo "./run_tests_with_ot.sh" echo "./run_tests_with_ot.sh"

View File

@@ -12,7 +12,7 @@ export ENABLE_OPENTELEMETRY=false
export OTEL_ENABLED=false export OTEL_ENABLED=false
# Run Django tests (Django will auto-discover all tests) # Run Django tests (Django will auto-discover all tests)
python3 manage.py test -v2 python3 manage.py test -v3
echo "" echo ""
echo "Tests completed successfully (OpenTelemetry disabled)" echo "Tests completed successfully (OpenTelemetry disabled)"

View File

@@ -14,7 +14,7 @@ export OTEL_SERVICE_NAME=ivatar-test
export OTEL_ENVIRONMENT=test export OTEL_ENVIRONMENT=test
# Run Django tests (Django will auto-discover all tests) # Run Django tests (Django will auto-discover all tests)
python3 manage.py test -v2 python3 manage.py test -v3
echo "" echo ""
echo "Tests completed successfully (OpenTelemetry enabled)" echo "Tests completed successfully (OpenTelemetry enabled)"