diff --git a/tests/quality/config.yaml b/tests/quality/config.yaml index c1090bb9..7242c0b6 100644 --- a/tests/quality/config.yaml +++ b/tests/quality/config.yaml @@ -114,6 +114,11 @@ tests: # we need to convert GHSAs to CVEs so that we can filter based on date - name: nvd use_cache: true + # note: the base images for most of the github test images are alpine and we are including the NVD namespace. + - name: alpine + use_cache: true + - name: wolfi + use_cache: true images: - docker.io/anchore/test_images:java-56d52bc@sha256:10008791acbc5866de04108746a02a0c4029ce3a4400a9b3dad45d7f2245f9da - docker.io/anchore/test_images:npm-56d52bc@sha256:ba42ded8613fc643d407a050faf5ab48cfb405ad3ef2015bf6feeb5dff44738d diff --git a/tests/quality/configure.py b/tests/quality/configure.py index f1d1f30d..0aad3cdb 100644 --- a/tests/quality/configure.py +++ b/tests/quality/configure.py @@ -333,24 +333,35 @@ def select_providers(cfg: Config, output_json: bool): changed_files = changes() selected_providers = set() - for test in cfg.tests: - if not test.provider: - continue - search_globs = [f"src/vunnel/providers/{test.provider}/**"] + # look for gate changes, if any, then run all providers + gate_globs = ["tests/quality/*.py", "tests/quality/*.yaml", "tests/quality/vulnerability-match-labels/**"] + + for search_glob in gate_globs: + for changed_file in changed_files: + if fnmatch.fnmatch(changed_file, search_glob): + selected_providers = {test.provider for test in cfg.tests} + + if not selected_providers: + # there are no gate changes, so look for provider-specific changes + for test in cfg.tests: + if not test.provider: + continue + + search_globs = [f"src/vunnel/providers/{test.provider}/**"] - for additional_provider in test.additional_providers: - search_globs.append(f"src/vunnel/providers/{additional_provider.name}/**") + for additional_provider in test.additional_providers: + search_globs.append(f"src/vunnel/providers/{additional_provider.name}/**") - for g in test.additional_trigger_globs: - search_globs.append(g) + for g in test.additional_trigger_globs: + search_globs.append(g) - for search_glob in search_globs: - for changed_file in changed_files: - if fnmatch.fnmatch(changed_file, search_glob): - logging.debug(f"provider {test.provider} is affected by file change {changed_file}") - selected_providers.add(test.provider) - break + for search_glob in search_globs: + for changed_file in changed_files: + if fnmatch.fnmatch(changed_file, search_glob): + logging.debug(f"provider {test.provider} is affected by file change {changed_file}") + selected_providers.add(test.provider) + break sorted_providers = sorted(selected_providers) diff --git a/tests/quality/vulnerability-match-labels b/tests/quality/vulnerability-match-labels index 3e6c878d..9f4f1a04 160000 --- a/tests/quality/vulnerability-match-labels +++ b/tests/quality/vulnerability-match-labels @@ -1 +1 @@ -Subproject commit 3e6c878d144f95aab8bbb398ad0e7c717d6c3c31 +Subproject commit 9f4f1a0443d71146dd57bd21e02df5356b9074d9