|
| 1 | +name: Daily Telemetry E2E Tests |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * 0' # Run every Sunday at midnight UTC |
| 6 | + |
| 7 | + workflow_dispatch: # Allow manual triggering |
| 8 | + inputs: |
| 9 | + test_pattern: |
| 10 | + description: 'Test pattern to run (default: tests/e2e/test_telemetry_e2e.py)' |
| 11 | + required: false |
| 12 | + default: 'tests/e2e/test_telemetry_e2e.py' |
| 13 | + type: string |
| 14 | + |
| 15 | +jobs: |
| 16 | + telemetry-e2e-tests: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + environment: azure-prod |
| 19 | + |
| 20 | + env: |
| 21 | + DATABRICKS_SERVER_HOSTNAME: ${{ secrets.DATABRICKS_HOST }} |
| 22 | + DATABRICKS_HTTP_PATH: ${{ secrets.TEST_PECO_WAREHOUSE_HTTP_PATH }} |
| 23 | + DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }} |
| 24 | + DATABRICKS_CATALOG: peco |
| 25 | + DATABRICKS_USER: ${{ secrets.TEST_PECO_SP_ID }} |
| 26 | + |
| 27 | + steps: |
| 28 | + #---------------------------------------------- |
| 29 | + # check-out repo and set-up python |
| 30 | + #---------------------------------------------- |
| 31 | + - name: Check out repository |
| 32 | + uses: actions/checkout@v4 |
| 33 | + |
| 34 | + - name: Set up python |
| 35 | + id: setup-python |
| 36 | + uses: actions/setup-python@v5 |
| 37 | + with: |
| 38 | + python-version: "3.10" |
| 39 | + |
| 40 | + #---------------------------------------------- |
| 41 | + # ----- install & configure poetry ----- |
| 42 | + #---------------------------------------------- |
| 43 | + - name: Install Poetry |
| 44 | + uses: snok/install-poetry@v1 |
| 45 | + with: |
| 46 | + virtualenvs-create: true |
| 47 | + virtualenvs-in-project: true |
| 48 | + installer-parallel: true |
| 49 | + |
| 50 | + #---------------------------------------------- |
| 51 | + # load cached venv if cache exists |
| 52 | + #---------------------------------------------- |
| 53 | + - name: Load cached venv |
| 54 | + id: cached-poetry-dependencies |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: .venv |
| 58 | + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ github.event.repository.name }}-${{ hashFiles('**/poetry.lock') }} |
| 59 | + |
| 60 | + #---------------------------------------------- |
| 61 | + # install dependencies if cache does not exist |
| 62 | + #---------------------------------------------- |
| 63 | + - name: Install dependencies |
| 64 | + run: poetry install --no-interaction --all-extras |
| 65 | + |
| 66 | + #---------------------------------------------- |
| 67 | + # run telemetry E2E tests |
| 68 | + #---------------------------------------------- |
| 69 | + - name: Run telemetry E2E tests |
| 70 | + run: | |
| 71 | + TEST_PATTERN="${{ github.event.inputs.test_pattern || 'tests/e2e/test_telemetry_e2e.py' }}" |
| 72 | + echo "Running tests: $TEST_PATTERN" |
| 73 | + poetry run python -m pytest $TEST_PATTERN -v -s |
| 74 | + |
| 75 | + #---------------------------------------------- |
| 76 | + # upload test results on failure |
| 77 | + #---------------------------------------------- |
| 78 | + - name: Upload test results on failure |
| 79 | + if: failure() |
| 80 | + uses: actions/upload-artifact@v4 |
| 81 | + with: |
| 82 | + name: telemetry-test-results |
| 83 | + path: | |
| 84 | + .pytest_cache/ |
| 85 | + tests-unsafe.log |
| 86 | + retention-days: 7 |
| 87 | + |
0 commit comments