diff options
| author | J08nY | 2025-02-27 13:02:52 +0100 |
|---|---|---|
| committer | J08nY | 2025-02-27 13:02:52 +0100 |
| commit | ee26043a0cc2b03300a4e40a01c7b447a4524418 (patch) | |
| tree | 67e89637184d69f2b78339a173141f0dd5f898d2 /tests/cc | |
| parent | 27abe1d969703a87aace43334969939be1b8c9f8 (diff) | |
| download | sec-certs-ee26043a0cc2b03300a4e40a01c7b447a4524418.tar.gz sec-certs-ee26043a0cc2b03300a4e40a01c7b447a4524418.tar.zst sec-certs-ee26043a0cc2b03300a4e40a01c7b447a4524418.zip | |
Move flaky remote tests into "scheduled" workflow.
Diffstat (limited to 'tests/cc')
| -rw-r--r-- | tests/cc/test_cc_dataset.py | 4 | ||||
| -rw-r--r-- | tests/cc/test_cc_maintenance_updates.py | 3 | ||||
| -rw-r--r-- | tests/cc/test_cc_protection_profiles.py | 5 | ||||
| -rw-r--r-- | tests/cc/test_cc_schemes.py | 36 |
4 files changed, 23 insertions, 25 deletions
diff --git a/tests/cc/test_cc_dataset.py b/tests/cc/test_cc_dataset.py index cba06a64..127f4e5b 100644 --- a/tests/cc/test_cc_dataset.py +++ b/tests/cc/test_cc_dataset.py @@ -77,13 +77,13 @@ def test_download_and_convert_pdfs(toy_dataset: CCDataset, data_dir: Path): ) -@pytest.mark.slow -@pytest.mark.xfail(reason="May fail due to network issues.") +@pytest.mark.remote def test_from_web(): dset = CCDataset.from_web() assert len(dset) > 6000 +@pytest.mark.remote def test_archive_fits(): fsize = helpers.query_file_size(config.cc_latest_full_archive) tmpdir = helpers.tempdir_for(fsize) diff --git a/tests/cc/test_cc_maintenance_updates.py b/tests/cc/test_cc_maintenance_updates.py index 683c8644..dd470aa3 100644 --- a/tests/cc/test_cc_maintenance_updates.py +++ b/tests/cc/test_cc_maintenance_updates.py @@ -77,8 +77,7 @@ def test_to_pandas(mu_dset: CCDatasetMaintenanceUpdates): assert set(df.columns) == set(CCMaintenanceUpdate.pandas_columns) - {"dgst"} -@pytest.mark.slow -@pytest.mark.xfail(reason="May fail due to network issues.") +@pytest.mark.remote def test_from_web(): dset = CCDatasetMaintenanceUpdates.from_web() assert dset is not None diff --git a/tests/cc/test_cc_protection_profiles.py b/tests/cc/test_cc_protection_profiles.py index 4cf61fd0..4f1bdee7 100644 --- a/tests/cc/test_cc_protection_profiles.py +++ b/tests/cc/test_cc_protection_profiles.py @@ -71,14 +71,13 @@ def test_get_certs_from_web(pp_data_dir: Path, toy_pp_dataset: ProtectionProfile assert isinstance(cert.web_data.version, str) -@pytest.mark.slow -@pytest.mark.xfail(reason="May fail due to network issues.") +@pytest.mark.remote def test_from_web(): dset = ProtectionProfileDataset.from_web() assert len(dset) > 400 -@pytest.mark.xfail(reason="May fail due to error on CC server") +@pytest.mark.remote def test_download_html_files(): with TemporaryDirectory() as tmp_dir: dset = ProtectionProfileDataset(root_dir=Path(tmp_dir)) diff --git a/tests/cc/test_cc_schemes.py b/tests/cc/test_cc_schemes.py index 68599bc5..e14ebf6f 100644 --- a/tests/cc/test_cc_schemes.py +++ b/tests/cc/test_cc_schemes.py @@ -2,7 +2,6 @@ from datetime import date from urllib.parse import urlparse import pytest -from requests import RequestException import sec_certs.sample.cc_scheme as CCSchemes from sec_certs.dataset.auxiliary_dataset_handling import CCSchemeDatasetHandler @@ -21,7 +20,7 @@ def absolute_urls(results): return True -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_australia(): ineval = CCSchemes.get_australia_in_evaluation() assert len(ineval) != 0 @@ -33,7 +32,7 @@ def canada_certified(): return CCSchemes.get_canada_certified() -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote @pytest.mark.slow def test_canada(canada_certified): assert len(canada_certified) != 0 @@ -43,7 +42,7 @@ def test_canada(canada_certified): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote @pytest.mark.slow def test_anssi(): certified = CCSchemes.get_france_certified() @@ -54,7 +53,7 @@ def test_anssi(): assert absolute_urls(archived) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote @pytest.mark.slow def test_bsi(): certified = CCSchemes.get_germany_certified() @@ -62,7 +61,7 @@ def test_bsi(): assert absolute_urls(certified) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_india(): certified = CCSchemes.get_india_certified() assert len(certified) != 0 @@ -72,7 +71,7 @@ def test_india(): assert absolute_urls(archived) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_italy(): certified = CCSchemes.get_italy_certified() assert len(certified) != 0 @@ -82,7 +81,7 @@ def test_italy(): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_japan(): certified = CCSchemes.get_japan_certified() assert len(certified) != 0 @@ -95,7 +94,7 @@ def test_japan(): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_malaysia(): certified = CCSchemes.get_malaysia_certified() assert len(certified) != 0 @@ -108,7 +107,7 @@ def test_malaysia(): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_netherlands(): certified = CCSchemes.get_netherlands_certified() assert len(certified) != 0 @@ -118,7 +117,7 @@ def test_netherlands(): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_norway(): certified = CCSchemes.get_norway_certified() assert len(certified) != 0 @@ -128,7 +127,7 @@ def test_norway(): assert absolute_urls(archived) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_korea(): certified = CCSchemes.get_korea_certified() assert len(certified) != 0 @@ -138,7 +137,7 @@ def test_korea(): assert absolute_urls(archived) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_poland(): certified = CCSchemes.get_poland_certified() assert len(certified) != 0 @@ -148,7 +147,7 @@ def test_poland(): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_singapore(): certified = CCSchemes.get_singapore_certified() assert len(certified) != 0 @@ -161,14 +160,14 @@ def test_singapore(): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_spain(): certified = CCSchemes.get_spain_certified() assert len(certified) != 0 assert absolute_urls(certified) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_sweden(): certified = CCSchemes.get_sweden_certified() assert len(certified) != 0 @@ -181,14 +180,14 @@ def test_sweden(): assert absolute_urls(ineval) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_turkey(): certified = CCSchemes.get_turkey_certified() assert len(certified) != 0 assert absolute_urls(certified) -@pytest.mark.xfail(reason="May fail due to server errors.", raises=RequestException) +@pytest.mark.remote def test_usa(): certified = CCSchemes.get_usa_certified() assert len(certified) != 0 @@ -225,6 +224,7 @@ def test_single_match(cert_one: CCCertificate): assert matcher.match(cert_one) > 95 +@pytest.mark.remote def test_matching(toy_dataset: CCDataset, canada_certified): matches, scores = CCSchemeMatcher.match_all(canada_certified, "CA", toy_dataset) assert len(matches) == 1 |
