From 4e6d47b6415c8e959a34784ea5217138a1662b78 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sat, 23 Mar 2024 11:19:33 -0400 Subject: [PATCH 1/8] chore[build]: add xfail_strict, clean up setup.cfg move coverage-related options to CI *only*. simplify quicktest.sh --- .github/workflows/test.yml | 43 ++++++++++++++++++++++---------------- quicktest.sh | 4 ++-- setup.cfg | 7 ++----- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0497d436c9..664166835b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -134,15 +134,16 @@ jobs: run: pip freeze - 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 \ + run: > + pytest + -m "not fuzzing" + --optimize ${{ matrix.opt-mode }} + --evm-version ${{ matrix.evm-version }} + ${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} + ${{ matrix.memorymock && '--memorymock' || '' }} + --cov-branch + --cov-report xml:coverage.xml + --cov=vyper tests/ - name: Upload Coverage @@ -192,17 +193,23 @@ 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: | - pytest \ - -m "fuzzing" \ - --splits 120 \ - --group ${{ matrix.group }} \ - --splitting-algorithm least_duration \ - --dist worksteal \ - -r aR tests/ + run: > + pytest + -m "fuzzing" + --splits 120 + --group ${{ matrix.group }} + --splitting-algorithm least_duration + --cov-branch + --cov-report xml:coverage.xml + --cov=vyper + tests/ - name: Upload Coverage uses: codecov/codecov-action@v4 diff --git a/quicktest.sh b/quicktest.sh index cd2ee4d624..cd3aad1f15 100755 --- a/quicktest.sh +++ b/quicktest.sh @@ -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 "$@" diff --git a/setup.cfg b/setup.cfg index 1d159fb17a..ba3807f90a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,13 +25,10 @@ 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"') From 6c274e077b8109183616b189023ec05524c0151f Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sat, 23 Mar 2024 11:21:07 -0400 Subject: [PATCH 2/8] add build scope --- .github/workflows/pull-request.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index f36b465bb5..082a366656 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -37,6 +37,7 @@ jobs: # venom: venom changes scopes: | ci + build docs test lang From da4b53dc683b794871c7dfeee4f140708ee05370 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sat, 23 Mar 2024 13:06:14 -0400 Subject: [PATCH 3/8] fix mypy config --- Makefile | 2 +- setup.cfg | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index aa0508f2f6..b616eebab8 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ test: lint: mypy black flake8 isort mypy: - mypy --install-types --non-interactive --follow-imports=silent --ignore-missing-imports --implicit-optional -p vyper + mypy --no-check-untyped-defs --follow-imports=silent --ignore-missing-imports --implicit-optional -p vyper black: black -C -t py311 vyper/ tests/ setup.py --force-exclude=vyper/version.py diff --git a/setup.cfg b/setup.cfg index ba3807f90a..257bf3f06a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,5 +32,7 @@ xfail_strict = true markers = fuzzing: Run Hypothesis fuzz test suite (deselect with '-m "not fuzzing"') -[tool:mypy] +[mypy] ignore_missing_imports = True +no_check_untyped_defs = True +check_untyped_defs = False From 5637950d69dc820bf8d21a89ebdc5a498e8f3952 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sat, 23 Mar 2024 13:33:12 -0400 Subject: [PATCH 4/8] suppress annoying mypy notes https://stackoverflow.com/a/75768131 --- Makefile | 7 ++++++- setup.cfg | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b616eebab8..3bb7d5ad0a 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,12 @@ test: lint: mypy black flake8 isort mypy: - mypy --no-check-untyped-defs --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 diff --git a/setup.cfg b/setup.cfg index 257bf3f06a..467c6a372b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,8 +31,3 @@ testpaths = tests xfail_strict = true markers = fuzzing: Run Hypothesis fuzz test suite (deselect with '-m "not fuzzing"') - -[mypy] -ignore_missing_imports = True -no_check_untyped_defs = True -check_untyped_defs = False From dacf62c6a30f4e60c938a4be3e8055b80c83646e Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sat, 23 Mar 2024 13:33:53 -0400 Subject: [PATCH 5/8] pin pytest to lower version cf. https://github.com/pytest-dev/pytest-xdist/issues/1034 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a7943409fd..b403405122 100644 --- a/setup.py +++ b/setup.py @@ -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", "pytest-split>=0.7.0,<1.0", "eth-tester[py-evm]>=0.10.0b4,<0.11", "eth_abi>=4.0.0,<5.0.0", From 74986b2803b077f290c8032156a4999ac8cb85b4 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sat, 23 Mar 2024 14:14:26 -0400 Subject: [PATCH 6/8] fix yaml formatting --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 664166835b..3dc79657f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -134,7 +134,7 @@ jobs: run: pip freeze - name: Run tests - run: > + run: >- pytest -m "not fuzzing" --optimize ${{ matrix.opt-mode }} @@ -193,14 +193,14 @@ 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: > + run: >- curl --location "https://raw.githubusercontent.com/vyperlang/vyper-test-durations/master/test_durations" -o .test_durations - name: Run tests - run: > + run: >- pytest -m "fuzzing" --splits 120 From 4b2ffc2969fba8e38c456dac53192b0fce004419 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 25 Mar 2024 13:29:58 -0400 Subject: [PATCH 7/8] fix lint, again --- .github/workflows/test.yml | 43 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dc79657f6..05c22588d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -134,16 +134,16 @@ jobs: run: pip freeze - name: Run tests - run: >- + run: | pytest - -m "not fuzzing" - --optimize ${{ matrix.opt-mode }} - --evm-version ${{ matrix.evm-version }} - ${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} - ${{ matrix.memorymock && '--memorymock' || '' }} - --cov-branch - --cov-report xml:coverage.xml - --cov=vyper + -m "not fuzzing" \ + --optimize ${{ matrix.opt-mode }} \ + --evm-version ${{ matrix.evm-version }} \ + ${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \ + ${{ matrix.memorymock && '--memorymock' || '' }} \ + --cov-branch \ + --cov-report xml:coverage.xml \ + --cov=vyper \ tests/ - name: Upload Coverage @@ -193,22 +193,19 @@ 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: >- - pytest - -m "fuzzing" - --splits 120 - --group ${{ matrix.group }} - --splitting-algorithm least_duration - --cov-branch - --cov-report xml:coverage.xml - --cov=vyper + run: | + pytest \ + -m "fuzzing" \ + --splits 120 \ + --group ${{ matrix.group }} \ + --splitting-algorithm least_duration \ + --cov-branch \ + --cov-report xml:coverage.xml \ + --cov=vyper \ tests/ - name: Upload Coverage From 104f022a74ba5802f87d56d28e1fa3876f311e77 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Mon, 25 Mar 2024 13:44:05 -0400 Subject: [PATCH 8/8] missing backslash --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05c22588d9..8bd03de79b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -135,7 +135,7 @@ jobs: - name: Run tests run: | - pytest + pytest \ -m "not fuzzing" \ --optimize ${{ matrix.opt-mode }} \ --evm-version ${{ matrix.evm-version }} \