Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,55 @@ jobs:
RESOURCE_PREFIX: ${{ steps.set-resource-prefix.outputs.prefix }}


Run-Telemetry-Tests:
needs: [Authorize, Check-changed-files]
if: needs.Check-changed-files.outputs.code_changed == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
airflow-version: ["2.10"]
dbt-version: ["1.9"]
env:
SCARF_NO_ANALYTICS: "false"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
persist-credentials: false

- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: |
~/.cache/pip
.local/share/hatch/
key: telemetry-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ matrix.dbt-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('cosmos/__init__.py') }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}

- name: Install packages and dependencies
run: |
python -m pip install uv
uv pip install --system "hatch>=1.14.2"
hatch -e tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ matrix.dbt-version }} run pip freeze

- name: Run telemetry tests
run: |
Comment thread
pankajkoti marked this conversation as resolved.
hatch run tests.py${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ matrix.dbt-version }}:test-telemetry

- name: Upload coverage to Github
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: coverage-telemetry-test-${{ matrix.python-version }}-${{ matrix.airflow-version }}-${{ matrix.dbt-version }}
path: .coverage
include-hidden-files: true

Comment thread
pankajkoti marked this conversation as resolved.
Run-Performance-Tests:
needs: [Authorize, Check-changed-files]
if: needs.Check-changed-files.outputs.code_changed == 'true'
Expand Down Expand Up @@ -744,6 +793,7 @@ jobs:
- Run-Integration-Tests
- Run-Integration-Tests-Expensive
- Run-Kubernetes-Tests
- Run-Telemetry-Tests
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ test-integration-dbtf = 'sh scripts/test/integration-dbtf.sh'
test-integration-dbt-1-5-4 = 'sh scripts/test/integration-dbt-1-5-4.sh'
test-integration-dbt-async = 'sh scripts/test/integration-dbt-async.sh {matrix:dbt}'
test-integration-expensive = 'sh scripts/test/integration-expensive.sh'
test-telemetry = 'sh scripts/test/telemetry.sh'

test-performance = 'sh scripts/test/performance.sh'
test-performance-setup = 'sh scripts/test/performance-setup.sh {matrix:dbt}'
Expand Down
1 change: 1 addition & 0 deletions scripts/test/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ pytest -vv \
--ignore=tests/test_example_k8s_dags.py \
--ignore=tests/operators/test_watcher_kubernetes_integration.py \
--ignore=dev/dags/cross_project_dbt_ls_dag.py \
--ignore=tests/test_telemetry.py \
-k 'not (simple_dag_async or example_cosmos_python_models or example_virtualenv or jaffle_shop_kubernetes or jaffle_shop_watcher_kubernetes)'
12 changes: 12 additions & 0 deletions scripts/test/telemetry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -x
set -e

pytest -vv \
--cov=cosmos \
--cov-report=term-missing \
--cov-report=xml \
--durations=0 \
-m integration \
tests/test_telemetry.py
Loading