fix: Add python-dotenv back to dev dependencies #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🧪 Feature Integration Tests | |
| on: | |
| push: | |
| branches: [ feature-* ] | |
| pull_request: | |
| branches: [ feature-* ] | |
| workflow_dispatch: | |
| workflow_call: | |
| jobs: | |
| # 🔬 Unit tests on multiple Python versions (fast) | |
| unit-tests: | |
| name: 🧪 Unit Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] # Use Python 3.12 for tests | |
| steps: | |
| - name: 📥 Checkout code | |
| uses: actions/checkout@v4 | |
| - name: 🐍 Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: 📦 Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: ⚙️ Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install -e ".[dev]" | |
| - name: 🧪 Run unit tests | |
| run: | | |
| python scripts/run-all.py --ci | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/src | |
| # 🔗 Integration tests with Python-managed NocoDB instance | |
| integration-test: | |
| name: 🔗 Integration Tests (Python-Managed) | |
| runs-on: ubuntu-latest | |
| needs: unit-tests | |
| steps: | |
| - name: 📥 Checkout code | |
| uses: actions/checkout@v4 | |
| - name: 🐍 Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: ⚙️ Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install -e ".[dev]" | |
| - name: 🐳 Setup NocoDB Container | |
| run: | | |
| # Make script executable | |
| chmod +x scripts/ci-setup.sh | |
| # Run setup script | |
| CONTAINER_NAME=nocodb-integration-test \ | |
| NOCODB_PORT=8080 \ | |
| NC_ADMIN_EMAIL=test@integration.local \ | |
| NC_ADMIN_PASSWORD=IntegrationTest123 \ | |
| ./scripts/ci-setup.sh setup | |
| # Verify that config files were created | |
| echo "=== Checking generated config files ===" | |
| ls -la nocodb-config.json .env.test 2>/dev/null || echo "Config files not found!" | |
| # Show config content (without sensitive data in logs) | |
| if [ -f nocodb-config.json ]; then | |
| echo "✅ nocodb-config.json created" | |
| cat nocodb-config.json | jq 'del(.NOCODB_TOKEN)' || cat nocodb-config.json | |
| fi | |
| - name: 🔗 Run integration tests | |
| run: | | |
| # Verify config files are available | |
| if [ ! -f nocodb-config.json ]; then | |
| echo "❌ ERROR: nocodb-config.json not found!" | |
| exit 1 | |
| fi | |
| # Run tests with config file | |
| python -m pytest tests/test_integration.py -v --tb=short | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/src | |
| SKIP_INTEGRATION: 0 | |
| # Test configuration | |
| TEST_TIMEOUT: 300 | |
| MAX_FILE_SIZE_MB: 1 | |
| CLEANUP_TEST_DATA: true | |
| - name: 🔍 Show Docker logs on failure | |
| if: failure() | |
| run: | | |
| echo "=== Available Docker containers ===" | |
| docker ps -a | |
| echo "=== Docker system info ===" | |
| docker system df | |
| echo "=== Check for NocoDB container logs ===" | |
| docker logs nocodb-integration-test 2>/dev/null || echo "Container not found or no logs" | |
| - name: 🧹 Cleanup Docker containers | |
| if: always() | |
| run: | | |
| # Use cleanup script | |
| chmod +x scripts/ci-setup.sh | |
| CONTAINER_NAME=nocodb-integration-test ./scripts/ci-setup.sh cleanup | |
| # ⚡ Optional performance tests (when PR has performance label) | |
| performance-test: | |
| name: ⚡ Performance Tests (Python-managed) | |
| runs-on: ubuntu-latest | |
| needs: unit-tests | |
| if: contains(github.event.pull_request.labels.*.name, 'test-performance') | |
| steps: | |
| - name: 📥 Checkout code | |
| uses: actions/checkout@v4 | |
| - name: 🐍 Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: ⚙️ Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install -e ".[dev]" | |
| - name: 🐳 Setup NocoDB Container | |
| run: | | |
| # Make script executable | |
| chmod +x scripts/ci-setup.sh | |
| # Run setup script with performance test configuration | |
| CONTAINER_NAME=nocodb-integration-test \ | |
| NOCODB_PORT=8080 \ | |
| NC_ADMIN_EMAIL=test@integration.local \ | |
| NC_ADMIN_PASSWORD=IntegrationTest123 \ | |
| ./scripts/ci-setup.sh setup | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/src | |
| - name: ⚡ Run Python-managed performance tests | |
| run: | | |
| python -m pytest tests/test_integration.py::TestIntegration::test_bulk_operations -v --tb=short | |
| python -m pytest tests/test_performance.py -v --tb=short 2>/dev/null || echo "Performance tests not available" | |
| env: | |
| PYTHONPATH: ${{ github.workspace }}/src | |
| SKIP_INTEGRATION: 0 | |
| # Performance test configuration | |
| PERFORMANCE_TEST_RECORDS: 100 | |
| BULK_TEST_BATCH_SIZE: 20 | |
| TEST_TIMEOUT: 600 | |
| - name: 🧹 Cleanup performance test containers | |
| if: always() | |
| run: | | |
| # Use cleanup script | |
| chmod +x scripts/ci-setup.sh | |
| CONTAINER_NAME=nocodb-integration-test ./scripts/ci-setup.sh cleanup |