Skip to content

Commit 51ebf40

Browse files
sentrivanaantonpirker
authored andcommitted
ref(ci): Create a separate test group for AI (#3198)
1 parent 83992b3 commit 51ebf40

File tree

3 files changed

+143
-46
lines changed

3 files changed

+143
-46
lines changed
+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Test AI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release/**
7+
- sentry-sdk-2.0
8+
pull_request:
9+
# Cancel in progress workflows on pull_requests.
10+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
permissions:
15+
contents: read
16+
env:
17+
BUILD_CACHE_KEY: ${{ github.sha }}
18+
CACHED_BUILD_PATHS: |
19+
${{ github.workspace }}/dist-serverless
20+
jobs:
21+
test-ai-latest:
22+
name: AI (latest)
23+
timeout-minutes: 30
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
python-version: ["3.7","3.9","3.11","3.12"]
29+
# python3.6 reached EOL and is no longer being supported on
30+
# new versions of hosted runners on Github Actions
31+
# ubuntu-20.04 is the last version that supported python3.6
32+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
33+
os: [ubuntu-20.04]
34+
steps:
35+
- uses: actions/[email protected]
36+
- uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Setup Test Env
40+
run: |
41+
pip install coverage tox
42+
- name: Erase coverage
43+
run: |
44+
coverage erase
45+
- name: Test anthropic latest
46+
run: |
47+
set -x # print commands that are executed
48+
./scripts/runtox.sh "py${{ matrix.python-version }}-anthropic-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
49+
- name: Test cohere latest
50+
run: |
51+
set -x # print commands that are executed
52+
./scripts/runtox.sh "py${{ matrix.python-version }}-cohere-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
53+
- name: Test langchain latest
54+
run: |
55+
set -x # print commands that are executed
56+
./scripts/runtox.sh "py${{ matrix.python-version }}-langchain-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
57+
- name: Test openai latest
58+
run: |
59+
set -x # print commands that are executed
60+
./scripts/runtox.sh "py${{ matrix.python-version }}-openai-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
61+
- name: Test huggingface_hub latest
62+
run: |
63+
set -x # print commands that are executed
64+
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
65+
- name: Generate coverage XML
66+
run: |
67+
coverage combine .coverage*
68+
coverage xml -i
69+
- uses: codecov/codecov-action@v4
70+
with:
71+
token: ${{ secrets.CODECOV_TOKEN }}
72+
files: coverage.xml
73+
test-ai-pinned:
74+
name: AI (pinned)
75+
timeout-minutes: 30
76+
runs-on: ${{ matrix.os }}
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
python-version: ["3.7","3.9","3.11","3.12"]
81+
# python3.6 reached EOL and is no longer being supported on
82+
# new versions of hosted runners on Github Actions
83+
# ubuntu-20.04 is the last version that supported python3.6
84+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
85+
os: [ubuntu-20.04]
86+
steps:
87+
- uses: actions/[email protected]
88+
- uses: actions/setup-python@v5
89+
with:
90+
python-version: ${{ matrix.python-version }}
91+
- name: Setup Test Env
92+
run: |
93+
pip install coverage tox
94+
- name: Erase coverage
95+
run: |
96+
coverage erase
97+
- name: Test anthropic pinned
98+
run: |
99+
set -x # print commands that are executed
100+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-anthropic" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
101+
- name: Test cohere pinned
102+
run: |
103+
set -x # print commands that are executed
104+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cohere" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
105+
- name: Test langchain pinned
106+
run: |
107+
set -x # print commands that are executed
108+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
109+
- name: Test openai pinned
110+
run: |
111+
set -x # print commands that are executed
112+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
113+
- name: Test huggingface_hub pinned
114+
run: |
115+
set -x # print commands that are executed
116+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huggingface_hub" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
117+
- name: Generate coverage XML
118+
run: |
119+
coverage combine .coverage*
120+
coverage xml -i
121+
- uses: codecov/codecov-action@v4
122+
with:
123+
token: ${{ secrets.CODECOV_TOKEN }}
124+
files: coverage.xml
125+
check_required_tests:
126+
name: All AI tests passed
127+
needs: test-ai-pinned
128+
# Always run this, even if a dependent job failed
129+
if: always()
130+
runs-on: ubuntu-20.04
131+
steps:
132+
- name: Check for failures
133+
if: contains(needs.test-ai-pinned.result, 'failure') || contains(needs.test-ai-pinned.result, 'skipped')
134+
run: |
135+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integrations-data-processing.yml

+1-41
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python-version: ["3.6","3.7","3.8","3.9","3.11","3.12"]
28+
python-version: ["3.6","3.7","3.8","3.11","3.12"]
2929
# python3.6 reached EOL and is no longer being supported on
3030
# new versions of hosted runners on Github Actions
3131
# ubuntu-20.04 is the last version that supported python3.6
@@ -44,10 +44,6 @@ jobs:
4444
- name: Erase coverage
4545
run: |
4646
coverage erase
47-
- name: Test anthropic latest
48-
run: |
49-
set -x # print commands that are executed
50-
./scripts/runtox.sh "py${{ matrix.python-version }}-anthropic-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
5147
- name: Test arq latest
5248
run: |
5349
set -x # print commands that are executed
@@ -60,26 +56,10 @@ jobs:
6056
run: |
6157
set -x # print commands that are executed
6258
./scripts/runtox.sh "py${{ matrix.python-version }}-celery-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
63-
- name: Test cohere latest
64-
run: |
65-
set -x # print commands that are executed
66-
./scripts/runtox.sh "py${{ matrix.python-version }}-cohere-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
6759
- name: Test huey latest
6860
run: |
6961
set -x # print commands that are executed
7062
./scripts/runtox.sh "py${{ matrix.python-version }}-huey-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
71-
- name: Test langchain latest
72-
run: |
73-
set -x # print commands that are executed
74-
./scripts/runtox.sh "py${{ matrix.python-version }}-langchain-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
75-
- name: Test openai latest
76-
run: |
77-
set -x # print commands that are executed
78-
./scripts/runtox.sh "py${{ matrix.python-version }}-openai-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
79-
- name: Test huggingface_hub latest
80-
run: |
81-
set -x # print commands that are executed
82-
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
8363
- name: Test rq latest
8464
run: |
8565
set -x # print commands that are executed
@@ -118,10 +98,6 @@ jobs:
11898
- name: Erase coverage
11999
run: |
120100
coverage erase
121-
- name: Test anthropic pinned
122-
run: |
123-
set -x # print commands that are executed
124-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-anthropic" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
125101
- name: Test arq pinned
126102
run: |
127103
set -x # print commands that are executed
@@ -134,26 +110,10 @@ jobs:
134110
run: |
135111
set -x # print commands that are executed
136112
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-celery" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
137-
- name: Test cohere pinned
138-
run: |
139-
set -x # print commands that are executed
140-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cohere" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
141113
- name: Test huey pinned
142114
run: |
143115
set -x # print commands that are executed
144116
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huey" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
145-
- name: Test langchain pinned
146-
run: |
147-
set -x # print commands that are executed
148-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
149-
- name: Test openai pinned
150-
run: |
151-
set -x # print commands that are executed
152-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
153-
- name: Test huggingface_hub pinned
154-
run: |
155-
set -x # print commands that are executed
156-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huggingface_hub" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
157117
- name: Test rq pinned
158118
run: |
159119
set -x # print commands that are executed

scripts/split-tox-gh-actions/split-tox-gh-actions.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@
5858
"Common": [
5959
"common",
6060
],
61+
"AI": [
62+
"anthropic",
63+
"cohere",
64+
"langchain",
65+
"openai",
66+
"huggingface_hub",
67+
],
6168
"AWS Lambda": [
6269
# this is separate from Cloud Computing because only this one test suite
6370
# needs to run with access to GitHub secrets
@@ -70,15 +77,10 @@
7077
"gcp",
7178
],
7279
"Data Processing": [
73-
"anthropic",
7480
"arq",
7581
"beam",
7682
"celery",
77-
"cohere",
7883
"huey",
79-
"langchain",
80-
"openai",
81-
"huggingface_hub",
8284
"rq",
8385
],
8486
"Databases": [

0 commit comments

Comments
 (0)