Skip to content

Commit

Permalink
ci: optimize ci runtime (DataDog#11798)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlangdon authored Dec 19, 2024
1 parent d197a00 commit f810101
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 40 deletions.
19 changes: 0 additions & 19 deletions .gitlab/package.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
build_base_venvs:
extends: .testrunner
stage: package
parallel:
matrix:
- PYTHON_VERSION: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
variables:
CMAKE_BUILD_PARALLEL_LEVEL: 12
PIP_VERBOSE: 1
script:
- pip install riot==0.20.0
- riot -P -v generate --python=$PYTHON_VERSION
artifacts:
name: venv_$PYTHON_VERSION
paths:
- .riot/venv_*
- ddtrace/**/*.so*
- ddtrace/internal/datadog/profiling/crashtracker/crashtracker_exe*

download_ddtrace_artifacts:
image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0
tags: [ "arch:amd64" ]
Expand Down
14 changes: 3 additions & 11 deletions .gitlab/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,9 @@ variables:
PYTEST_ADDOPTS: "-s"
# CI_DEBUG_SERVICES: "true"

.testrunner:
image: registry.ddbuild.io/images/mirror/dd-trace-py/testrunner:0a50e839f4b1600f02157518b8d016451b346578@sha256:5dae9bc7872f69b31b612690f0748c7ad71ab90ef28a754b2ae93d0ba505837b
# DEV: we have a larger pool of amd64 runners, prefer that over arm64
tags: [ "arch:amd64" ]
timeout: 20m
before_script:
- pyenv global 3.12 3.7 3.8 3.9 3.10 3.11 3.13
- export _CI_DD_AGENT_URL=http://${HOST_IP}:8126/


{{services.yml}}
include:
- local: ".gitlab/services.yml"
- local: ".gitlab/testrunner.yml"

.test_base_hatch:
extends: .testrunner
Expand Down
7 changes: 5 additions & 2 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,12 @@ extra-dependencies = [
"pytest-cov",
"hypothesis<6.45.1"
]
[envs.meta-testing.env-vars]
DD_CIVISIBILITY_FLAKY_RETRY_ENABLED = "0"

[envs.meta-testing.scripts]
meta-testing = [
"pytest {args} tests/meta"
test = [
"pytest {args} --no-ddtrace tests/meta"
]

[envs.integration_test]
Expand Down
9 changes: 1 addition & 8 deletions scripts/gen_gitlab_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ def gen_required_suites() -> None:
circleci_jobs = set(circleci_config["jobs"].keys())

# Copy the template file
TESTS_GEN.write_text(
(GITLAB / "tests.yml").read_text().replace(r"{{services.yml}}", (GITLAB / "services.yml").read_text())
)
TESTS_GEN.write_text((GITLAB / "tests.yml").read_text())
# Generate the list of suites to run
with TESTS_GEN.open("a") as f:
for suite in required_suites:
Expand Down Expand Up @@ -162,11 +160,6 @@ def check(name: str, command: str, paths: t.Set[str]) -> None:
command="hatch run lint:suitespec-check",
paths={"*"},
)
check(
name="conftest",
command="hatch run meta-testing:meta-testing",
paths={"**conftest.py"},
)


# -----------------------------------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions tests/suitespec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ components:
vendor:
- ddtrace/vendor/*
suites:
conftest:
parallelism: 1
paths:
- 'conftest.py'
- '**/conftest.py'
pattern: meta-testing
runner: hatch
snapshot: false
ddtracerun:
parallelism: 6
paths:
Expand Down

0 comments on commit f810101

Please sign in to comment.