Skip to content

Commit 1a40e93

Browse files
feat[test]: add xfail_strict, clean up setup.cfg (#3889)
this commit adds `xfail_strict` to pytest options, and cleans up some code relating to test and lint setup: - move pytest coverage-enabling options to CI *only* - suppress annoying mypy notes - add `--dist worksteal` to setup.cfg - pin pytest-xdist due to a regression (pytest-dev/pytest-xdist#1034)
1 parent 6e9b2c9 commit 1a40e93

File tree

6 files changed

+21
-17
lines changed

6 files changed

+21
-17
lines changed

.github/workflows/pull-request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
# venom: venom changes
3939
scopes: |
4040
ci
41+
build
4142
docs
4243
test
4344
lang

.github/workflows/test.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,14 @@ jobs:
136136
- name: Run tests
137137
run: |
138138
pytest \
139-
--dist worksteal \
140139
-m "not fuzzing" \
141140
--optimize ${{ matrix.opt-mode }} \
142141
--evm-version ${{ matrix.evm-version }} \
143142
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \
144143
${{ matrix.memorymock && '--memorymock' || '' }} \
145-
--showlocals -r aR \
144+
--cov-branch \
145+
--cov-report xml:coverage.xml \
146+
--cov=vyper \
146147
tests/
147148
148149
- name: Upload Coverage
@@ -192,7 +193,8 @@ jobs:
192193
# NOTE: if the tests get poorly distributed, run this and commit the resulting `.test_durations` file to the `vyper-test-durations` repo.
193194
# `pytest -m "fuzzing" --store-durations -r aR tests/`
194195
- name: Fetch test-durations
195-
run: curl --location "https://raw.githubusercontent.com/vyperlang/vyper-test-durations/master/test_durations" -o .test_durations
196+
run: |
197+
curl --location "https://raw.githubusercontent.com/vyperlang/vyper-test-durations/master/test_durations" -o .test_durations
196198
197199
- name: Run tests
198200
run: |
@@ -201,8 +203,10 @@ jobs:
201203
--splits 120 \
202204
--group ${{ matrix.group }} \
203205
--splitting-algorithm least_duration \
204-
--dist worksteal \
205-
-r aR tests/
206+
--cov-branch \
207+
--cov-report xml:coverage.xml \
208+
--cov=vyper \
209+
tests/
206210
207211
- name: Upload Coverage
208212
uses: codecov/codecov-action@v4

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ test:
2020
lint: mypy black flake8 isort
2121

2222
mypy:
23-
mypy --install-types --non-interactive --follow-imports=silent --ignore-missing-imports --implicit-optional -p vyper
23+
mypy \
24+
--disable-error-code "annotation-unchecked" \
25+
--follow-imports=silent \
26+
--ignore-missing-imports \
27+
--implicit-optional \
28+
-p vyper
2429

2530
black:
2631
black -C -t py311 vyper/ tests/ setup.py --force-exclude=vyper/version.py

quicktest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# ./quicktest.sh
55
# ./quicktest.sh tests/.../mytest.py
66

7-
# run pytest but bail out on first error and suppress coverage.
7+
# run pytest but bail out on first error
88
# useful for dev workflow
9-
pytest --dist worksteal -q --no-cov -s --instafail -x --disable-warnings "$@"
9+
pytest -q -s --instafail -x --disable-warnings "$@"

setup.cfg

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@ line_length = 100
2525

2626
[tool:pytest]
2727
addopts = -n auto
28-
--cov-branch
29-
--cov-report term
30-
--cov-report html
31-
--cov-report xml
32-
--cov=vyper
28+
--dist worksteal
3329
python_files = test_*.py
3430
testpaths = tests
31+
xfail_strict = true
3532
markers =
3633
fuzzing: Run Hypothesis fuzz test suite (deselect with '-m "not fuzzing"')
37-
38-
[tool:mypy]
39-
ignore_missing_imports = True

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"pytest>=8.0,<9.0",
1212
"pytest-cov>=4.1,<5.0",
1313
"pytest-instafail>=0.4,<1.0",
14-
"pytest-xdist>=3.5,<4.0",
14+
"pytest-xdist>=3.0,<3.4",
1515
"pytest-split>=0.7.0,<1.0",
1616
"eth-tester[py-evm]>=0.10.0b4,<0.11",
1717
"eth_abi>=4.0.0,<5.0.0",

0 commit comments

Comments
 (0)