Skip to content

Commit 2eefaa5

Browse files
committed
simplify selecting nowarn/nocover in tests
hatch gets in the way a lot more than it helps - stop re-running failing tests - show the test environment
1 parent 043876b commit 2eefaa5

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

.github/workflows/main.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ defaults:
1313
run:
1414
shell: bash -eux {0}
1515

16+
env:
17+
HATCH_ENV: "cov"
18+
1619
jobs:
1720
check_release:
1821
runs-on: ubuntu-latest
@@ -54,20 +57,29 @@ jobs:
5457
steps:
5558
- uses: actions/checkout@v4
5659
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
57-
- name: Run the tests
58-
if: ${{ !startsWith(matrix.python-version, 'pypy') && !startsWith(matrix.os, 'windows') }}
60+
61+
- name: disable warnings on pypy or windows
62+
if: ${{ startsWith(matrix.python-version, 'pypy') || startsWith(matrix.os, 'windows') }}
5963
run: |
60-
hatch run cov:test --cov-fail-under 75
61-
env:
62-
PYTHONTRACEMALLOC: "10"
63-
- name: Run the tests on pypy
64+
echo "PYTEST_ADDOPTS=${PYTEST_ADDOPTS:-} -W default" >> $GITHUB_ENV
65+
shell: bash
66+
67+
- name: disable coverage on pypy
6468
if: ${{ startsWith(matrix.python-version, 'pypy') }}
6569
run: |
66-
hatch run test:nowarn || hatch run test:nowarn --lf
67-
- name: Run the tests on windows
68-
if: ${{ startsWith(matrix.os, 'windows') }}
70+
echo "HATCH_ENV=test" >> $GITHUB_ENV
71+
72+
- name: show env
6973
run: |
70-
hatch run cov:nowarn || hatch run test:nowarn --lf
74+
hatch -e ${HATCH_ENV} run python -VV
75+
hatch -e ${HATCH_ENV} run pip freeze
76+
77+
- name: Run the tests
78+
run: |
79+
hatch run ${HATCH_ENV}:test
80+
env:
81+
PYTHONTRACEMALLOC: "10"
82+
7183
- uses: jupyterlab/maintainer-tools/.github/actions/upload-coverage@v1
7284

7385
coverage:
@@ -122,7 +134,7 @@ jobs:
122134
python_version: "3.10"
123135
- name: Run the unit tests
124136
run: |
125-
hatch -vv run test:nowarn || hatch run test:nowarn --lf
137+
hatch -vv run test:nowarn
126138
127139
test_prereleases:
128140
name: Test Prereleases
@@ -135,7 +147,7 @@ jobs:
135147
dependency_type: pre
136148
- name: Run the tests
137149
run: |
138-
hatch run test:nowarn || hatch run test:nowarn --lf
150+
hatch run test:nowarn
139151
140152
make_sdist:
141153
name: Make SDist
@@ -155,4 +167,4 @@ jobs:
155167
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
156168
- uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1
157169
with:
158-
test_command: pytest -vv || pytest -vv --lf
170+
test_command: pytest -vv

0 commit comments

Comments
 (0)