Skip to content

Commit d524f0e

Browse files
basic e2e test for force telemetry verification (databricks#708)
* basic e2e test for force telemetry verification Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * Added more integration test scenarios Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * default on telemetry + logs to investigate failing test Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * fixed linting issue Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * added more logs to identify server side flag evaluation Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * remove unused logs Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * fix broken test case for default enable telemetry Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * redcude test length and made more reusable code Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> * removed telemetry e2e to daily single run Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com> --------- Signed-off-by: Nikhil Suri <nikhil.suri@databricks.com>
1 parent 8d5e155 commit d524f0e

File tree

3 files changed

+436
-2
lines changed

3 files changed

+436
-2
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+

.github/workflows/integration.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,9 @@ jobs:
5454
#----------------------------------------------
5555
# run test suite
5656
#----------------------------------------------
57-
- name: Run e2e tests
58-
run: poetry run python -m pytest tests/e2e -n auto
57+
- name: Run e2e tests (excluding daily-only tests)
58+
run: |
59+
# Exclude telemetry E2E tests from PR runs (run daily instead)
60+
poetry run python -m pytest tests/e2e \
61+
--ignore=tests/e2e/test_telemetry_e2e.py \
62+
-n auto

0 commit comments

Comments
 (0)