Skip to content

Commit ad99861

Browse files
maxrjonesd-v-b
andauthored
chore: separate benchmarks into a distinct CI job (#3873)
* chore: separate benchmarks into a separate job * Maintain code coverage --------- Co-authored-by: Davis Bennett <davis.v.bennett@gmail.com>
1 parent a4c4404 commit ad99861

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,36 @@ jobs:
155155
run: |
156156
hatch run doctest:test
157157
158+
benchmarks:
159+
name: Benchmark smoke test
160+
runs-on: ubuntu-latest
161+
steps:
162+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
163+
with:
164+
fetch-depth: 0
165+
persist-credentials: false
166+
- name: Set up Python
167+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
168+
with:
169+
python-version: '3.13'
170+
cache: 'pip'
171+
- name: Install Hatch
172+
uses: pypa/hatch@257e27e51a6a5616ed08a39a408a21c35c9931bc
173+
with:
174+
version: '1.16.5'
175+
- name: Run Benchmarks
176+
run: |
177+
hatch env run --env "test.py3.13-minimal" run-benchmark
178+
158179
test-complete:
159180
name: Test complete
160181

161182
needs:
162183
[
163184
test,
164185
test-upstream-and-min-deps,
165-
doctests
186+
doctests,
187+
benchmarks
166188
]
167189
if: always()
168190
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ matrix.deps.dependency-groups = [
172172

173173
[tool.hatch.envs.test.scripts]
174174
run-coverage = [
175-
"coverage run --source=src -m pytest --junitxml=junit.xml -o junit_family=legacy {args:}",
175+
"coverage run --source=src -m pytest --ignore tests/benchmarks --junitxml=junit.xml -o junit_family=legacy {args:}",
176176
"coverage xml",
177177
]
178178
run-coverage-html = [
179-
"coverage run --source=src -m pytest {args:}",
179+
"coverage run --source=src -m pytest --ignore tests/benchmarks {args:}",
180180
"coverage html",
181181
]
182182
run = "pytest --ignore tests/benchmarks"

tests/test_codecs/test_codecs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def test_morton_exact_order() -> None:
219219
(1, 1),
220220
(5, 1, 3),
221221
(1, 4, 1, 2),
222+
(5, 5, 5), # triggers argsort strategy (n_z/n_total > 4)
222223
],
223224
)
224225
def test_morton_is_permutation(shape: tuple[int, ...]) -> None:

0 commit comments

Comments
 (0)