Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
- name: Run async tests
if: env.sbom != 'true'
run: >
pytest -n 4 -v
pytest -n 4 -v --durations=50
--ignore=test/test_cli.py
--ignore=test/test_cvedb.py
--ignore=test/test_requirements.py
Expand All @@ -180,7 +180,7 @@ jobs:
- name: Run synchronous tests
if: env.sbom != 'true'
run: >
pytest -v
pytest -v --durations=50
test/test_cli.py
test/test_cvedb.py

Expand Down Expand Up @@ -323,7 +323,7 @@ jobs:
env:
LONG_TESTS: ${{ steps.git-diff.outputs.value }}
run: >
pytest --cov --cov-append -n 4 -v
pytest --cov --cov-append -n 4 -v --durations=50
--ignore=test/test_cli.py
--ignore=test/test_cvedb.py
--ignore=test/test_requirements.py
Expand All @@ -334,7 +334,7 @@ jobs:
env:
LONG_TESTS: ${{ steps.git-diff.outputs.value }}
run: >
pytest -v --cov --cov-append --cov-report=xml
pytest -v --cov --cov-append --cov-report=xml --durations=50
test/test_cli.py
test/test_cvedb.py
- name: Upload code coverage to codecov
Expand Down Expand Up @@ -463,18 +463,18 @@ jobs:
env:
EXTERNAL_SYSTEM: ${{ steps.git-diff.outputs.value }}
run: >
pytest -v
pytest -v --durations=0
test/test_source_osv.py
test/test_source_gad.py
test/test_source_nvd.py
test/test_nvd_api.py
test/test_cvedb.py
test/test_available_fix.py
- name: Run HTML tests
run: pytest -v -n auto test/test_html.py
run: pytest -v -n auto test/test_html.py --durations=0
- name: Run json tests as they may fail due to NVD data validation issue or download timing
run: >
pytest -v
pytest -v --durations=0
test/test_json.py

windows_long_tests:
Expand Down Expand Up @@ -546,15 +546,15 @@ jobs:
python -m cve_bin_tool.cli test/assets/test-kerberos-5-1.15.1.out
- name: Run async tests
run: >
pytest --cov --cov-append -n 4 -v
pytest --cov --cov-append -n 4 -v --durations=50
--ignore=test/test_cli.py
--ignore=test/test_cvedb.py
--ignore=test/test_requirements.py
--ignore=test/test_html.py
--ignore=test/test_json.py
- name: Run synchronous tests
run: >
pytest -v --cov --cov-append --cov-report=xml
pytest -v --cov --cov-append --cov-report=xml --durations=50
test/test_cli.py
test/test_cvedb.py
- name: Cache conda
Expand All @@ -581,7 +581,7 @@ jobs:
python -m pip install --upgrade -r dev-requirements.txt
python -m pip install --upgrade .
- name: Test PDF generation on Windows
run: pytest test/test_output_engine.py -k test_output_pdf --cov --cov-append --cov-report=xml
run: pytest test/test_output_engine.py -k test_output_pdf --cov --cov-append --cov-report=xml --durations=50
- name: Upload code coverage to codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
Expand Down
14 changes: 12 additions & 2 deletions test/test_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,17 @@ def test_false_positive(self):
@pytest.mark.parametrize(
"product, version, version_strings",
(
(d["product"], d["version"], d["version_strings"])
pytest.param(
d["product"],
d["version"],
d["version_strings"],
marks=[
pytest.mark.skipif(
not LONG_TESTS(),
reason="Test reduction in short tests",
)
],
)
for list_data in mapping_test_data
for d in list_data
),
Expand Down Expand Up @@ -275,7 +285,7 @@ def condensed_filepath(self, url, package_name):
for d in list_data
),
)
@pytest.mark.skipif(not LONG_TESTS, reason="Skipping long tests")
@pytest.mark.skipif(not LONG_TESTS(), reason="Skipping long tests")
def test_version_in_package(
self, url, package_name, product, version, other_products
):
Expand Down
Loading