Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[test]: add xfail_strict, clean up setup.cfg #3889

Merged
1 change: 1 addition & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
# venom: venom changes
scopes: |
ci
build
docs
test
lang
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ jobs:
- name: Run tests
run: |
pytest \
--dist worksteal \
-m "not fuzzing" \
--optimize ${{ matrix.opt-mode }} \
--evm-version ${{ matrix.evm-version }} \
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \
${{ matrix.memorymock && '--memorymock' || '' }} \
--showlocals -r aR \
--cov-branch \
--cov-report xml:coverage.xml \
--cov=vyper \
tests/

- name: Upload Coverage
Expand Down Expand Up @@ -192,7 +193,8 @@ jobs:
# NOTE: if the tests get poorly distributed, run this and commit the resulting `.test_durations` file to the `vyper-test-durations` repo.
# `pytest -m "fuzzing" --store-durations -r aR tests/`
- name: Fetch test-durations
run: curl --location "https://raw.githubusercontent.com/vyperlang/vyper-test-durations/master/test_durations" -o .test_durations
run: |
curl --location "https://raw.githubusercontent.com/vyperlang/vyper-test-durations/master/test_durations" -o .test_durations

- name: Run tests
run: |
Expand All @@ -201,8 +203,10 @@ jobs:
--splits 120 \
--group ${{ matrix.group }} \
--splitting-algorithm least_duration \
--dist worksteal \
-r aR tests/
--cov-branch \
--cov-report xml:coverage.xml \
--cov=vyper \
tests/

- name: Upload Coverage
uses: codecov/codecov-action@v4
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ test:
lint: mypy black flake8 isort

mypy:
mypy --install-types --non-interactive --follow-imports=silent --ignore-missing-imports --implicit-optional -p vyper
mypy \
--disable-error-code "annotation-unchecked" \
--follow-imports=silent \
--ignore-missing-imports \
--implicit-optional \
-p vyper

black:
black -C -t py311 vyper/ tests/ setup.py --force-exclude=vyper/version.py
Expand Down
4 changes: 2 additions & 2 deletions quicktest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# ./quicktest.sh
# ./quicktest.sh tests/.../mytest.py

# run pytest but bail out on first error and suppress coverage.
# run pytest but bail out on first error
# useful for dev workflow
pytest --dist worksteal -q --no-cov -s --instafail -x --disable-warnings "$@"
pytest -q -s --instafail -x --disable-warnings "$@"
10 changes: 2 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,9 @@ line_length = 100

[tool:pytest]
addopts = -n auto
--cov-branch
--cov-report term
--cov-report html
--cov-report xml
--cov=vyper
--dist worksteal
python_files = test_*.py
testpaths = tests
xfail_strict = true
markers =
fuzzing: Run Hypothesis fuzz test suite (deselect with '-m "not fuzzing"')

[tool:mypy]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"pytest>=8.0,<9.0",
"pytest-cov>=4.1,<5.0",
"pytest-instafail>=0.4,<1.0",
"pytest-xdist>=3.5,<4.0",
"pytest-xdist>=3.0,<3.4",
charles-cooper marked this conversation as resolved.
Show resolved Hide resolved
"pytest-split>=0.7.0,<1.0",
"eth-tester[py-evm]>=0.10.0b4,<0.11",
"eth_abi>=4.0.0,<5.0.0",
Expand Down