#!/bin/bash
# Run tests locally, skipping Bluesky tests that require external API credentials
# OpenTelemetry instrumentation is always enabled, but export is disabled for local testing

echo "Running tests locally (skipping Bluesky tests, OpenTelemetry export disabled)..."
echo "============================================================================="

# OpenTelemetry instrumentation is always enabled, but disable export for local testing
export OTEL_EXPORT_ENABLED=false
export OTEL_SERVICE_NAME=ivatar-local
export OTEL_ENVIRONMENT=development

# Run Django tests excluding Bluesky tests (OpenTelemetry tests are included)
python3 manage.py test \
    --exclude-tag=bluesky \
    -v2

echo ""
echo "To run all tests including Bluesky (requires API credentials):"
echo "python3 manage.py test -v3"
echo ""
echo "To run only Bluesky tests:"
echo "python3 manage.py test ivatar.ivataraccount.test_views_bluesky -v3"
echo ""
echo "To run tests with OpenTelemetry export enabled:"
echo "OTEL_EXPORT_ENABLED=true python3 manage.py test -v2"
echo ""
echo "Note: OpenTelemetry instrumentation is always enabled. Only export is controlled by OTEL_EXPORT_ENABLED."
