Skip to content

Commit

Permalink
DISCOVERY-621: Mark slow tests
Browse files Browse the repository at this point in the history
Using data from Jenkins, add `slow` marker to all tests that on average
take at least 30 seconds to complete.

Relates to: DISCOVERY-621
  • Loading branch information
mirekdlugosz committed Jul 3, 2024
1 parent 0840606 commit 6ecc544
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions camayoc/tests/qpc/api/v1/reports/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
has_raw_facts = partial(expected_data_has_attribute, attr_name="raw_facts")


@pytest.mark.slow
@pytest.mark.runs_scan
@pytest.mark.parametrize("scan_name", scan_names(has_product))
def test_products_found_deployment_report(scans, scan_name):
Expand Down Expand Up @@ -96,6 +97,7 @@ def test_products_found_deployment_report(scans, scan_name):
)


@pytest.mark.slow
@pytest.mark.runs_scan
@pytest.mark.parametrize("scan_name", scan_names(has_distribution))
def test_OS_found_deployment_report(scans, scan_name):
Expand Down
1 change: 1 addition & 0 deletions camayoc/tests/qpc/api/v1/scanjobs/test_run_scanjobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from camayoc.types.scans import ScanSimplifiedStatusEnum


@pytest.mark.slow
@pytest.mark.runs_scan
@pytest.mark.parametrize("scan_name", all_scan_names())
def test_scan_complete(scans, scan_name):
Expand Down
1 change: 1 addition & 0 deletions camayoc/tests/qpc/cli/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def source_option_attr(source_option, finished_scan):
return getattr(finished_scan, attr_name)


@pytest.mark.slow
@pytest.mark.runs_scan
@pytest.mark.parametrize("source_option", REPORT_SOURCE_OPTIONS)
@pytest.mark.parametrize("output_format", REPORT_OUTPUT_FORMATS)
Expand Down
3 changes: 3 additions & 0 deletions camayoc/tests/qpc/cli/test_scanjobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def contains_single_source(sources_in_scan):
assert report.get("sources")


@pytest.mark.slow
@pytest.mark.runs_scan
def test_scanjob_with_multiple_sources(qpc_server_config, data_provider):
"""Scan multiple source types.
Expand Down Expand Up @@ -101,6 +102,7 @@ def has_two_sources(sources_in_scan):
assert report.get("sources", []) != []


@pytest.mark.slow
@pytest.mark.runs_scan
def test_scanjob_with_disabled_products(isolated_filesystem, qpc_server_config, data_provider):
"""Perform a scan with optional products disabled.
Expand Down Expand Up @@ -159,6 +161,7 @@ def test_scanjob_with_disabled_products(isolated_filesystem, qpc_server_config,
assert len(errors_found) == 0, "\n================\n".join(errors_found)


@pytest.mark.slow
@pytest.mark.runs_scan
def test_scanjob_with_enabled_extended_products(qpc_server_config, data_provider):
"""Perform a scan with extended products enabled.
Expand Down
1 change: 1 addition & 0 deletions camayoc/tests/qpc/ui/test_endtoend.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def source_names():
yield pytest.param(source_definition.name, id=fixture_id)


@pytest.mark.slow
@pytest.mark.nightly_only
@pytest.mark.parametrize("source_name", source_names())
def test_end_to_end(tmp_path, cleaning_data_provider, ui_client: Client, source_name):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ filterwarnings = "ignore::urllib3.exceptions.InsecureRequestWarning"
markers = [
"ssh_keyfile_path: mark test with SSH key file path mapped to /sshkeys/ on the server (deselect with '-m \"not ssh_keyfile_path\"')",
"runs_scan: tests that run scans (might be slow!)",
"slow: tests that take a long time to run (on average, more than 30 seconds)",
"nightly_only: tests to execute only during nightly (or full) run, i.e. not during PR check; note that actual selection is implemented in discovery-ci",
"pr_only: tests to execute only during PR check run, i.e. not during nightly run; note that actual selection is implemented in discovery-ci",
]
Expand Down

0 comments on commit 6ecc544

Please sign in to comment.