Skip to content

Commit 70e2ada

Browse files
ci: use a fake key for system tests [backport 1.18] (#6703)
Backport 8973f5f from #6702 to 1.18. System tests are mandatory to merge PR. The issue is that system tests requires an API_KEY stored in secrests, and it's not possible to share secrets when the PR comes from a forks. Hacks exists, but none of them is fully satisfaying. Turns out that this key does not have to be a valid key for most scenario, as long as nothing is tested on the backend. So trying to use a fake key. ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [x] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) Co-authored-by: Charles de Beauchesne <[email protected]>
1 parent 8402cb5 commit 70e2ada

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/system-tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
git fetch origin ${{ github.event.pull_request.base.sha }}
2424
export PATHS=$(git diff --name-only HEAD ${{ github.event.pull_request.base.sha }})
25-
python -c "import os,sys,fnmatch;sys.exit(not bool([_ for pattern in {'ddtrace/*', 'setup*', 'pyproject.toml'} for _ in fnmatch.filter(os.environ['PATHS'].splitlines(), pattern)]))"
25+
python -c "import os,sys,fnmatch;sys.exit(not bool([_ for pattern in {'ddtrace/*', 'setup*', 'pyproject.toml', '.github/workflows/system-tests.yml'} for _ in fnmatch.filter(os.environ['PATHS'].splitlines(), pattern)]))"
2626
continue-on-error: true
2727

2828
system-tests:
@@ -38,7 +38,10 @@ jobs:
3838
env:
3939
TEST_LIBRARY: python
4040
WEBLOG_VARIANT: ${{ matrix.weblog-variant }}
41-
DD_API_KEY: ${{ secrets.DD_API_KEY }}
41+
# system-tests requires an API_KEY, but it does not have to be a valid key, as long as we don't run a scenario
42+
# that make assertion on backend data. Using a fake key allow to run system tests on PR originating from forks.
43+
# If ever it's needed, a valid key exists in the repo, using ${{ secrets.DD_API_KEY }}
44+
DD_API_KEY: 1234567890abcdef1234567890abcdef
4245
steps:
4346
- name: Setup python 3.9
4447
if: needs.needs-run.outputs.outcome == 'success'

0 commit comments

Comments
 (0)