Skip to content

Commit 82716c9

Browse files
committed
ci: Add new top-level orchestrator and upload coverage once
* new `test_orchestrator` template that sits on top of all sub test workflow * fix junit overwriting * one upload per workflow instead of per matrix entry
1 parent 53249b3 commit 82716c9

28 files changed

Lines changed: 597 additions & 672 deletions

.claude/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"Bash(ruff format:*)",
4040
"Bash(ruff check:*)",
4141
"Bash(mypy:*)",
42-
"Bash(uv run *)"
42+
"Bash(uv run *)",
43+
"Bash(./scripts/generate-test-files.sh)"
4344
],
4445
"deny": []
4546
}

.coveragerc36

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33

44
[run]
55
branch = true
6+
# Match pyproject.toml so the 3.6 container's data file combines with the rest.
7+
relative_files = true
8+
disable_warnings = couldnt-parse
69
omit =
710
/tmp/*
811
*/tests/*
912
*/.venv/*
1013

1114

15+
[paths]
16+
source =
17+
sentry_sdk/
18+
*/sentry_sdk/
19+
20+
1221
[report]
1322
exclude_lines =
1423
if TYPE_CHECKING:

.github/workflows/test-integrations-agents.yml

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,12 @@
33
# The template responsible for it is in
44
# scripts/split_tox_gh_actions/templates/base.jinja
55
name: Test Agents
6+
# Reusable workflow. It is invoked by the top-level `test.yml` orchestrator.
67
on:
7-
push:
8-
branches:
9-
- master
10-
- release/**
11-
- major/**
12-
pull_request:
13-
# Cancel in progress workflows on pull_requests.
14-
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
15-
concurrency:
16-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17-
cancel-in-progress: true
8+
workflow_call:
189
permissions:
1910
contents: read
2011
actions: read
21-
pull-requests: write
22-
statuses: write
2312
jobs:
2413
test-agents:
2514
name: Agents
@@ -39,7 +28,8 @@ jobs:
3928
- name: Install uv
4029
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4130
with:
42-
cache-suffix: ${{ github.workflow }}-${{ matrix.python-version }}
31+
cache-suffix: agents-${{ matrix.python-version }}
32+
enable-cache: ${{ matrix.python-version != '3.6' && matrix.python-version != '3.7' }}
4333
- name: Mark workspace safe for git (3.6/3.7 container)
4434
# needed to make git rev-parse work in the containers
4535
# subprocesses (e.g. sentry_sdk.utils.get_git_revision) can run git.
@@ -48,9 +38,6 @@ jobs:
4838
- name: Setup Test Env
4939
run: |
5040
uv sync
51-
- name: Erase coverage
52-
run: |
53-
uv run coverage erase
5441
- name: Test openai_agents
5542
run: |
5643
set -x # print commands that are executed
@@ -59,28 +46,17 @@ jobs:
5946
run: |
6047
set -x # print commands that are executed
6148
./scripts/runtox.sh "py${{ matrix.python-version }}-pydantic_ai"
62-
- name: Generate coverage XML
63-
if: ${{ !cancelled() }}
64-
run: |
65-
uv run coverage combine .coverage-sentry-*
66-
uv run coverage xml
67-
- name: Parse and Upload Coverage
49+
- name: Upload coverage data
6850
if: ${{ !cancelled() }}
69-
uses: getsentry/codecov-action@d90e69cdf071dfbb0430159125321dc09c424d4c # main
51+
continue-on-error: true
52+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
7053
with:
71-
token: ${{ secrets.GITHUB_TOKEN }}
72-
files: coverage.xml
73-
junit-xml-pattern: .junitxml
74-
base-branch: master
75-
verbose: true
76-
check_required_tests:
77-
name: All Agents tests passed
78-
needs: test-agents
79-
# Always run this, even if a dependent job failed
80-
if: always()
81-
runs-on: ubuntu-22.04
82-
steps:
83-
- name: Check for failures
84-
if: needs.test-agents.result != 'success'
85-
run: |
86-
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
54+
name: coverage-agents-${{ matrix.python-version }}
55+
# .coverage-* / .junitxml-* are dotfiles, excluded by default
56+
include-hidden-files: true
57+
path: |
58+
.coverage-sentry-*
59+
.junitxml-*
60+
if-no-files-found: 'ignore'
61+
retention-days: 1
62+
overwrite: true

.github/workflows/test-integrations-ai-workflow.yml

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,12 @@
33
# The template responsible for it is in
44
# scripts/split_tox_gh_actions/templates/base.jinja
55
name: Test AI Workflow
6+
# Reusable workflow. It is invoked by the top-level `test.yml` orchestrator.
67
on:
7-
push:
8-
branches:
9-
- master
10-
- release/**
11-
- major/**
12-
pull_request:
13-
# Cancel in progress workflows on pull_requests.
14-
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
15-
concurrency:
16-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17-
cancel-in-progress: true
8+
workflow_call:
189
permissions:
1910
contents: read
2011
actions: read
21-
pull-requests: write
22-
statuses: write
2312
jobs:
2413
test-ai_workflow:
2514
name: AI Workflow
@@ -39,7 +28,8 @@ jobs:
3928
- name: Install uv
4029
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4130
with:
42-
cache-suffix: ${{ github.workflow }}-${{ matrix.python-version }}
31+
cache-suffix: ai_workflow-${{ matrix.python-version }}
32+
enable-cache: ${{ matrix.python-version != '3.6' && matrix.python-version != '3.7' }}
4333
- name: Mark workspace safe for git (3.6/3.7 container)
4434
# needed to make git rev-parse work in the containers
4535
# subprocesses (e.g. sentry_sdk.utils.get_git_revision) can run git.
@@ -48,9 +38,6 @@ jobs:
4838
- name: Setup Test Env
4939
run: |
5040
uv sync
51-
- name: Erase coverage
52-
run: |
53-
uv run coverage erase
5441
- name: Test langchain-base
5542
run: |
5643
set -x # print commands that are executed
@@ -63,28 +50,17 @@ jobs:
6350
run: |
6451
set -x # print commands that are executed
6552
./scripts/runtox.sh "py${{ matrix.python-version }}-langgraph"
66-
- name: Generate coverage XML
67-
if: ${{ !cancelled() }}
68-
run: |
69-
uv run coverage combine .coverage-sentry-*
70-
uv run coverage xml
71-
- name: Parse and Upload Coverage
53+
- name: Upload coverage data
7254
if: ${{ !cancelled() }}
73-
uses: getsentry/codecov-action@d90e69cdf071dfbb0430159125321dc09c424d4c # main
55+
continue-on-error: true
56+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
7457
with:
75-
token: ${{ secrets.GITHUB_TOKEN }}
76-
files: coverage.xml
77-
junit-xml-pattern: .junitxml
78-
base-branch: master
79-
verbose: true
80-
check_required_tests:
81-
name: All AI Workflow tests passed
82-
needs: test-ai_workflow
83-
# Always run this, even if a dependent job failed
84-
if: always()
85-
runs-on: ubuntu-22.04
86-
steps:
87-
- name: Check for failures
88-
if: needs.test-ai_workflow.result != 'success'
89-
run: |
90-
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
58+
name: coverage-ai_workflow-${{ matrix.python-version }}
59+
# .coverage-* / .junitxml-* are dotfiles, excluded by default
60+
include-hidden-files: true
61+
path: |
62+
.coverage-sentry-*
63+
.junitxml-*
64+
if-no-files-found: 'ignore'
65+
retention-days: 1
66+
overwrite: true

.github/workflows/test-integrations-ai.yml

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,12 @@
33
# The template responsible for it is in
44
# scripts/split_tox_gh_actions/templates/base.jinja
55
name: Test AI
6+
# Reusable workflow. It is invoked by the top-level `test.yml` orchestrator.
67
on:
7-
push:
8-
branches:
9-
- master
10-
- release/**
11-
- major/**
12-
pull_request:
13-
# Cancel in progress workflows on pull_requests.
14-
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
15-
concurrency:
16-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17-
cancel-in-progress: true
8+
workflow_call:
189
permissions:
1910
contents: read
2011
actions: read
21-
pull-requests: write
22-
statuses: write
2312
jobs:
2413
test-ai:
2514
name: AI
@@ -39,7 +28,8 @@ jobs:
3928
- name: Install uv
4029
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4130
with:
42-
cache-suffix: ${{ github.workflow }}-${{ matrix.python-version }}
31+
cache-suffix: ai-${{ matrix.python-version }}
32+
enable-cache: ${{ matrix.python-version != '3.6' && matrix.python-version != '3.7' }}
4333
- name: Mark workspace safe for git (3.6/3.7 container)
4434
# needed to make git rev-parse work in the containers
4535
# subprocesses (e.g. sentry_sdk.utils.get_git_revision) can run git.
@@ -48,9 +38,6 @@ jobs:
4838
- name: Setup Test Env
4939
run: |
5040
uv sync
51-
- name: Erase coverage
52-
run: |
53-
uv run coverage erase
5441
- name: Test anthropic
5542
run: |
5643
set -x # print commands that are executed
@@ -79,28 +66,17 @@ jobs:
7966
run: |
8067
set -x # print commands that are executed
8168
./scripts/runtox.sh "py${{ matrix.python-version }}-openai-notiktoken"
82-
- name: Generate coverage XML
83-
if: ${{ !cancelled() }}
84-
run: |
85-
uv run coverage combine .coverage-sentry-*
86-
uv run coverage xml
87-
- name: Parse and Upload Coverage
69+
- name: Upload coverage data
8870
if: ${{ !cancelled() }}
89-
uses: getsentry/codecov-action@d90e69cdf071dfbb0430159125321dc09c424d4c # main
71+
continue-on-error: true
72+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
9073
with:
91-
token: ${{ secrets.GITHUB_TOKEN }}
92-
files: coverage.xml
93-
junit-xml-pattern: .junitxml
94-
base-branch: master
95-
verbose: true
96-
check_required_tests:
97-
name: All AI tests passed
98-
needs: test-ai
99-
# Always run this, even if a dependent job failed
100-
if: always()
101-
runs-on: ubuntu-22.04
102-
steps:
103-
- name: Check for failures
104-
if: needs.test-ai.result != 'success'
105-
run: |
106-
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
74+
name: coverage-ai-${{ matrix.python-version }}
75+
# .coverage-* / .junitxml-* are dotfiles, excluded by default
76+
include-hidden-files: true
77+
path: |
78+
.coverage-sentry-*
79+
.junitxml-*
80+
if-no-files-found: 'ignore'
81+
retention-days: 1
82+
overwrite: true

.github/workflows/test-integrations-cloud.yml

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,12 @@
33
# The template responsible for it is in
44
# scripts/split_tox_gh_actions/templates/base.jinja
55
name: Test Cloud
6+
# Reusable workflow. It is invoked by the top-level `test.yml` orchestrator.
67
on:
7-
push:
8-
branches:
9-
- master
10-
- release/**
11-
- major/**
12-
pull_request:
13-
# Cancel in progress workflows on pull_requests.
14-
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
15-
concurrency:
16-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17-
cancel-in-progress: true
8+
workflow_call:
189
permissions:
1910
contents: read
2011
actions: read
21-
pull-requests: write
22-
statuses: write
2312
jobs:
2413
test-cloud:
2514
name: Cloud
@@ -43,7 +32,8 @@ jobs:
4332
- name: Install uv
4433
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4534
with:
46-
cache-suffix: ${{ github.workflow }}-${{ matrix.python-version }}
35+
cache-suffix: cloud-${{ matrix.python-version }}
36+
enable-cache: ${{ matrix.python-version != '3.6' && matrix.python-version != '3.7' }}
4737
- name: Mark workspace safe for git (3.6/3.7 container)
4838
# needed to make git rev-parse work in the containers
4939
# subprocesses (e.g. sentry_sdk.utils.get_git_revision) can run git.
@@ -52,9 +42,6 @@ jobs:
5242
- name: Setup Test Env
5343
run: |
5444
uv sync
55-
- name: Erase coverage
56-
run: |
57-
uv run coverage erase
5845
- name: Test aws_lambda
5946
run: |
6047
set -x # print commands that are executed
@@ -75,28 +62,17 @@ jobs:
7562
run: |
7663
set -x # print commands that are executed
7764
./scripts/runtox.sh "py${{ matrix.python-version }}-gcp"
78-
- name: Generate coverage XML
79-
if: ${{ !cancelled() }}
80-
run: |
81-
uv run coverage combine .coverage-sentry-*
82-
uv run coverage xml
83-
- name: Parse and Upload Coverage
65+
- name: Upload coverage data
8466
if: ${{ !cancelled() }}
85-
uses: getsentry/codecov-action@d90e69cdf071dfbb0430159125321dc09c424d4c # main
67+
continue-on-error: true
68+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
8669
with:
87-
token: ${{ secrets.GITHUB_TOKEN }}
88-
files: coverage.xml
89-
junit-xml-pattern: .junitxml
90-
base-branch: master
91-
verbose: true
92-
check_required_tests:
93-
name: All Cloud tests passed
94-
needs: test-cloud
95-
# Always run this, even if a dependent job failed
96-
if: always()
97-
runs-on: ubuntu-22.04
98-
steps:
99-
- name: Check for failures
100-
if: needs.test-cloud.result != 'success'
101-
run: |
102-
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
70+
name: coverage-cloud-${{ matrix.python-version }}
71+
# .coverage-* / .junitxml-* are dotfiles, excluded by default
72+
include-hidden-files: true
73+
path: |
74+
.coverage-sentry-*
75+
.junitxml-*
76+
if-no-files-found: 'ignore'
77+
retention-days: 1
78+
overwrite: true

0 commit comments

Comments
 (0)