Skip to content

Commit 5841ad0

Browse files
authored
ci: setup nightly repeated test runs using pytest-repeat (#1574)
1 parent a35cdd3 commit 5841ad0

12 files changed

Lines changed: 83 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
branches:
1616
- "pull-request/[0-9]+"
1717
- "main"
18+
schedule:
19+
# every 24 hours at midnight UTC
20+
- cron: "0 0 * * *"
1821

1922
jobs:
2023
ci-vars:
@@ -149,6 +152,7 @@ jobs:
149152
build-type: pull-request
150153
host-platform: ${{ matrix.host-platform }}
151154
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
155+
nruns: ${{ (github.event_name == 'schedule' && 100) || 1}}
152156

153157
# See test-linux-64 for why test jobs are split by platform.
154158
test-linux-aarch64:
@@ -171,6 +175,7 @@ jobs:
171175
build-type: pull-request
172176
host-platform: ${{ matrix.host-platform }}
173177
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
178+
nruns: ${{ (github.event_name == 'schedule' && 100) || 1}}
174179

175180
# See test-linux-64 for why test jobs are split by platform.
176181
test-windows:
@@ -193,6 +198,7 @@ jobs:
193198
build-type: pull-request
194199
host-platform: ${{ matrix.host-platform }}
195200
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
201+
nruns: ${{ (github.event_name == 'schedule' && 100) || 1}}
196202

197203
doc:
198204
name: Docs

.github/workflows/test-wheel-linux.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -19,6 +19,9 @@ on:
1919
matrix_filter:
2020
type: string
2121
default: "."
22+
nruns:
23+
type: number
24+
default: 1
2225

2326
defaults:
2427
run:
@@ -241,6 +244,9 @@ jobs:
241244
- name: Set up compute-sanitizer
242245
run: setup-sanitizer
243246

247+
- name: Set up test repetition on nightly runs
248+
run: echo "PYTEST_ADDOPTS=\"--count=${{ inputs.nruns }}\"" >> "$GITHUB_ENV"
249+
244250
- name: Run cuda.pathfinder tests with see_what_works
245251
env:
246252
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works

.github/workflows/test-wheel-windows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
matrix_filter:
2020
type: string
2121
default: "."
22+
nruns:
23+
type: number
24+
default: 1
2225

2326
jobs:
2427
compute-matrix:
@@ -213,6 +216,10 @@ jobs:
213216
host-platform: ${{ inputs.host-platform }}
214217
cuda-version: ${{ matrix.CUDA_VER }}
215218

219+
- name: Set up test repetition on nightly runs
220+
shell: bash --noprofile --norc -xeuo pipefail {0}
221+
run: echo "PYTEST_ADDOPTS=\"--count=${{ inputs.nruns }}\"" >> "$GITHUB_ENV"
222+
216223
- name: Run cuda.pathfinder tests with see_what_works
217224
env:
218225
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works

cuda_bindings/pixi.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cuda_bindings/pixi.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ cuda-bindings = { path = "." }
1717
pytest = ">=6.2.4"
1818
pytest-benchmark = ">=3.4.1"
1919
pytest-randomly = "*"
20+
pytest-repeat = "*"
2021
pyglet = ">=2.1.9"
2122
numpy = "*"
2223

cuda_bindings/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33
[build-system]
44
requires = [
@@ -45,6 +45,7 @@ test = [
4545
"numpy>=1.21.1",
4646
"pytest>=6.2.4",
4747
"pytest-benchmark>=3.4.1",
48+
"pytest-repeat",
4849
"pyglet>=2.1.9",
4950
]
5051

cuda_core/pixi.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cuda_core/pixi.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -15,6 +15,7 @@ cuda-core = { path = "." }
1515
pytest = "*"
1616
pytest-benchmark = "*"
1717
pytest-randomly = "*"
18+
pytest-repeat = "*"
1819

1920
[feature.cython-tests.dependencies]
2021
cython = ">=3.2,<3.3" # for tests that exercise APIs from cython

cuda_core/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -55,7 +55,7 @@ cu12 = ["cuda-bindings[all]==12.*"]
5555
cu13 = ["cuda-bindings[all]==13.*"]
5656

5757
[dependency-groups]
58-
test = ["cython>=3.2,<3.3", "setuptools", "pytest>=6.2.4", "pytest-randomly"]
58+
test = ["cython>=3.2,<3.3", "setuptools", "pytest>=6.2.4", "pytest-randomly", "pytest-repeat"]
5959
test-cu12 = ["cuda-core[test]", "cupy-cuda12x; python_version < '3.14'", "cuda-toolkit[cudart]==12.*"] # runtime headers needed by CuPy
6060
test-cu13 = ["cuda-core[test]", "cupy-cuda13x; python_version < '3.14'", "cuda-toolkit[cudart]==13.*"] # runtime headers needed by CuPy
6161
# free threaded build, cupy doesn't support free-threaded builds yet, so avoid installing it for now

0 commit comments

Comments
 (0)