Skip to content

Commit 1a9818c

Browse files
committed
run fuzz in CI
1 parent 80a6bbe commit 1a9818c

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ jobs:
4242
- name: Run tests
4343
run: python -m tox -e flake8_5,flake8_6
4444

45+
slow_tests:
46+
runs-on: ubuntu-latest
47+
strategy:
48+
fail-fast: false
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Set up Python 3.11
52+
uses: actions/setup-python@v3
53+
with:
54+
python-version: 3.11
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip setuptools tox
58+
python -m tox --notest --recreate -e flake8_6
59+
- name: Run tests
60+
run: python -m tox -e flake8_6 -- --onlyfuzz --no-cov -n auto
61+
4562
release:
4663
runs-on: ubuntu-latest
4764
needs: [check, test]

tests/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ def pytest_addoption(parser: pytest.Parser):
99
parser.addoption(
1010
"--runfuzz", action="store_true", default=False, help="run fuzz tests"
1111
)
12+
parser.addoption(
13+
"--onlyfuzz", action="store_true", default=False, help="only run fuzz tests"
14+
)
1215
parser.addoption(
1316
"--generate-autofix",
1417
action="store_true",
@@ -32,6 +35,13 @@ def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item
3235
if config.getoption("--runfuzz"):
3336
# --runfuzz given in cli: do not skip fuzz tests
3437
return
38+
39+
if config.getoption("--onlyfuzz"):
40+
for item in items.copy():
41+
if "fuzz" not in item.keywords:
42+
items.remove(item)
43+
return
44+
3545
skip_fuzz = pytest.mark.skip(reason="need --runfuzz option to run")
3646
for item in items:
3747
if "fuzz" in item.keywords:

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ deps =
1212
flake8_5: flake8>=5.0,<6.0
1313
pytest
1414
pytest-cov
15-
#pytest-xdist
15+
pytest-xdist
1616
hypothesis
1717
hypothesmith
1818
trio

0 commit comments

Comments
 (0)