Skip to content

Commit c9ea15c

Browse files
ci: optimize ci runtime [backport 2.19] (#11937)
Manual backport for #11798 into 2.19 - Remove redundant `build_base_venvs` - not needed by any downstream jobs, we have to re-do this in the tests-gen pipeline anyways - Move conftest hatch job from precheck to hatch stage - hatch jobs that have to install dev take a long time to run 6+ mins - Remove redundant `.testrunner` definition, and need for injecting `services.yml` into `tests.yml` template ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - 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: Brett Langdon <[email protected]>
1 parent ad2dc85 commit c9ea15c

File tree

5 files changed

+17
-46
lines changed

5 files changed

+17
-46
lines changed

.gitlab/package.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
build_base_venvs:
2-
extends: .testrunner
3-
stage: package
4-
parallel:
5-
matrix:
6-
- PYTHON_VERSION: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
7-
variables:
8-
CMAKE_BUILD_PARALLEL_LEVEL: 12
9-
PIP_VERBOSE: 1
10-
script:
11-
- pip install riot==0.20.0
12-
- riot -P -v generate --python=$PYTHON_VERSION
13-
artifacts:
14-
name: venv_$PYTHON_VERSION
15-
paths:
16-
- .riot/venv_*
17-
- ddtrace/**/*.so*
18-
- ddtrace/internal/datadog/profiling/crashtracker/crashtracker_exe*
19-
201
download_ddtrace_artifacts:
212
image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0
223
tags: [ "arch:amd64" ]

.gitlab/tests.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,9 @@ variables:
1010
PYTEST_ADDOPTS: "-s"
1111
# CI_DEBUG_SERVICES: "true"
1212

13-
.testrunner:
14-
image: registry.ddbuild.io/images/mirror/dd-trace-py/testrunner:0a50e839f4b1600f02157518b8d016451b346578@sha256:5dae9bc7872f69b31b612690f0748c7ad71ab90ef28a754b2ae93d0ba505837b
15-
# DEV: we have a larger pool of amd64 runners, prefer that over arm64
16-
tags: [ "arch:amd64" ]
17-
timeout: 20m
18-
before_script:
19-
- pyenv global 3.12 3.7 3.8 3.9 3.10 3.11 3.13
20-
- export _CI_DD_AGENT_URL=http://${HOST_IP}:8126/
21-
22-
23-
{{services.yml}}
13+
include:
14+
- local: ".gitlab/services.yml"
15+
- local: ".gitlab/testrunner.yml"
2416

2517
.test_base_hatch:
2618
extends: .testrunner

hatch.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,12 @@ extra-dependencies = [
154154
"pytest-cov",
155155
"hypothesis<6.45.1"
156156
]
157+
[envs.meta-testing.env-vars]
158+
DD_CIVISIBILITY_FLAKY_RETRY_ENABLED = "0"
159+
157160
[envs.meta-testing.scripts]
158-
meta-testing = [
159-
"pytest {args} tests/meta"
161+
test = [
162+
"pytest {args} --no-ddtrace tests/meta"
160163
]
161164

162165
[envs.integration_test]

scripts/gen_gitlab_config.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ def gen_required_suites() -> None:
8686
circleci_jobs = set(circleci_config["jobs"].keys())
8787

8888
# Copy the template file
89-
TESTS_GEN.write_text(
90-
(GITLAB / "tests.yml").read_text().replace(r"{{services.yml}}", (GITLAB / "services.yml").read_text())
91-
)
92-
89+
TESTS_GEN.write_text((GITLAB / "tests.yml").read_text())
9390
# Generate the list of suites to run
9491
with TESTS_GEN.open("a") as f:
9592
for suite in required_suites:
@@ -154,16 +151,6 @@ def check(name: str, command: str, paths: t.Set[str]) -> None:
154151
command="hatch run lint:suitespec-check",
155152
paths={"*"},
156153
)
157-
check(
158-
name="conftest",
159-
command="hatch run meta-testing:meta-testing",
160-
paths={"**conftest.py"},
161-
)
162-
check(
163-
name="slotscheck",
164-
command="hatch run slotscheck:_",
165-
paths={"**.py"},
166-
)
167154

168155

169156
# -----------------------------------------------------------------------------

tests/suitespec.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ components:
151151
vendor:
152152
- ddtrace/vendor/*
153153
suites:
154+
conftest:
155+
parallelism: 1
156+
paths:
157+
- 'conftest.py'
158+
- '**/conftest.py'
159+
pattern: meta-testing
160+
runner: hatch
161+
snapshot: false
154162
ddtracerun:
155163
parallelism: 6
156164
paths:

0 commit comments

Comments
 (0)