Skip to content

Commit ad86d61

Browse files
authored
fix(ci): Fix yaml generation script (#2695)
The generation script was supposed to raise an error if it detected that the integration test YAML files have changed but haven't been committed. The check is based on a hash of the contents of the YAML files, but there was a typo in the file names to consider (`integration` -> `integrations`), so it wasn't actually looking at any files and was always trivially true. Now it'll properly complain if changes are made to `tox.ini` or to some of the constants in the splitting script that result in new YAML files, but those are not part of the commit.
1 parent c8e9172 commit ad86d61

File tree

3 files changed

+28
-26
lines changed

3 files changed

+28
-26
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ jobs:
7676
run: |
7777
set -x # print commands that are executed
7878
./scripts/runtox.sh "py${{ matrix.python-version }}-pymongo-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
79+
- name: Test redis latest
80+
run: |
81+
set -x # print commands that are executed
82+
./scripts/runtox.sh "py${{ matrix.python-version }}-redis-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
83+
- name: Test rediscluster latest
84+
run: |
85+
set -x # print commands that are executed
86+
./scripts/runtox.sh "py${{ matrix.python-version }}-rediscluster-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
7987
- name: Test sqlalchemy latest
8088
run: |
8189
set -x # print commands that are executed
@@ -146,6 +154,14 @@ jobs:
146154
run: |
147155
set -x # print commands that are executed
148156
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pymongo" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
157+
- name: Test redis pinned
158+
run: |
159+
set -x # print commands that are executed
160+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-redis" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
161+
- name: Test rediscluster pinned
162+
run: |
163+
set -x # print commands that are executed
164+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-rediscluster" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
149165
- name: Test sqlalchemy pinned
150166
run: |
151167
set -x # print commands that are executed
@@ -205,6 +221,14 @@ jobs:
205221
run: |
206222
set -x # print commands that are executed
207223
./scripts/runtox.sh --exclude-latest "py2.7-pymongo" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
224+
- name: Test redis py27
225+
run: |
226+
set -x # print commands that are executed
227+
./scripts/runtox.sh --exclude-latest "py2.7-redis" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
228+
- name: Test rediscluster py27
229+
run: |
230+
set -x # print commands that are executed
231+
./scripts/runtox.sh --exclude-latest "py2.7-rediscluster" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
208232
- name: Test sqlalchemy py27
209233
run: |
210234
set -x # print commands that are executed

.github/workflows/test-integrations-web-frameworks-2.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ jobs:
6666
run: |
6767
set -x # print commands that are executed
6868
./scripts/runtox.sh "py${{ matrix.python-version }}-quart-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
69-
- name: Test redis latest
70-
run: |
71-
set -x # print commands that are executed
72-
./scripts/runtox.sh "py${{ matrix.python-version }}-redis-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
73-
- name: Test rediscluster latest
74-
run: |
75-
set -x # print commands that are executed
76-
./scripts/runtox.sh "py${{ matrix.python-version }}-rediscluster-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
7769
- name: Test sanic latest
7870
run: |
7971
set -x # print commands that are executed
@@ -142,14 +134,6 @@ jobs:
142134
run: |
143135
set -x # print commands that are executed
144136
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-quart" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
145-
- name: Test redis pinned
146-
run: |
147-
set -x # print commands that are executed
148-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-redis" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
149-
- name: Test rediscluster pinned
150-
run: |
151-
set -x # print commands that are executed
152-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-rediscluster" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
153137
- name: Test sanic pinned
154138
run: |
155139
set -x # print commands that are executed
@@ -207,14 +191,6 @@ jobs:
207191
run: |
208192
set -x # print commands that are executed
209193
./scripts/runtox.sh --exclude-latest "py2.7-quart" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
210-
- name: Test redis py27
211-
run: |
212-
set -x # print commands that are executed
213-
./scripts/runtox.sh --exclude-latest "py2.7-redis" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
214-
- name: Test rediscluster py27
215-
run: |
216-
set -x # print commands that are executed
217-
./scripts/runtox.sh --exclude-latest "py2.7-rediscluster" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
218194
- name: Test sanic py27
219195
run: |
220196
set -x # print commands that are executed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
files have been changed by the scripts execution. This is used in CI to check if the yaml files
1515
represent the current tox.ini file. (And if not the CI run fails.)
1616
"""
17+
1718
import configparser
1819
import hashlib
1920
import sys
@@ -155,7 +156,8 @@ def main(fail_on_changes):
155156

156157
if old_hash != new_hash:
157158
raise RuntimeError(
158-
"The yaml configuration files have changed. This means that tox.ini has changed "
159+
"The yaml configuration files have changed. This means that either `tox.ini` "
160+
"or one of the constants in `split-tox-gh-actions.py` has changed "
159161
"but the changes have not been propagated to the GitHub actions config files. "
160162
"Please run `python scripts/split-tox-gh-actions/split-tox-gh-actions.py` "
161163
"locally and commit the changes of the yaml configuration files to continue. "
@@ -235,7 +237,7 @@ def replace_and_sort(versions):
235237
def get_files_hash():
236238
"""Calculate a hash of all the yaml configuration files"""
237239
hasher = hashlib.md5()
238-
path_pattern = (OUT_DIR / "test-integration-*.yml").as_posix()
240+
path_pattern = (OUT_DIR / "test-integrations-*.yml").as_posix()
239241
for file in glob(path_pattern):
240242
with open(file, "rb") as f:
241243
buf = f.read()

0 commit comments

Comments
 (0)