From 52f3a6366a9d3a2b89cea4178867a96da7f24401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0oltis?= Date: Wed, 3 Apr 2024 09:42:01 +0200 Subject: [PATCH] add integration test that covers yanked packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit testing repo: https://github.com/cachito-testing/cachi2-pip-extra Signed-off-by: Michal Ĺ oltis --- .../test_data/pip_yanked/.build-config.yaml | 6 ++ .../integration/test_data/pip_yanked/bom.json | 63 +++++++++++++++++++ .../pip_yanked/fetch_deps_sha256sums.json | 5 ++ tests/integration/test_pip.py | 11 ++++ 4 files changed, 85 insertions(+) create mode 100644 tests/integration/test_data/pip_yanked/.build-config.yaml create mode 100644 tests/integration/test_data/pip_yanked/bom.json create mode 100644 tests/integration/test_data/pip_yanked/fetch_deps_sha256sums.json diff --git a/tests/integration/test_data/pip_yanked/.build-config.yaml b/tests/integration/test_data/pip_yanked/.build-config.yaml new file mode 100644 index 000000000..31fe7c492 --- /dev/null +++ b/tests/integration/test_data/pip_yanked/.build-config.yaml @@ -0,0 +1,6 @@ +environment_variables: +- name: PIP_FIND_LINKS + value: ${output_dir}/deps/pip +- name: PIP_NO_INDEX + value: 'true' +project_files: [] diff --git a/tests/integration/test_data/pip_yanked/bom.json b/tests/integration/test_data/pip_yanked/bom.json new file mode 100644 index 000000000..c32c9143c --- /dev/null +++ b/tests/integration/test_data/pip_yanked/bom.json @@ -0,0 +1,63 @@ +{ + "bomFormat": "CycloneDX", + "components": [ + { + "name": "black", + "properties": [ + { + "name": "cachi2:found_by", + "value": "cachi2" + } + ], + "purl": "pkg:pypi/black@21.11b0", + "type": "library", + "version": "21.11b0" + }, + { + "name": "foo", + "properties": [ + { + "name": "cachi2:found_by", + "value": "cachi2" + } + ], + "purl": "pkg:pypi/foo@0.1.0?vcs_url=git%2Bhttps://github.com/cachito-testing/cachi2-pip-extra.git%405f4d168cd573712e56914c326d5f7eff488d7f32", + "type": "library", + "version": "0.1.0" + }, + { + "name": "terminado", + "properties": [ + { + "name": "cachi2:found_by", + "value": "cachi2" + } + ], + "purl": "pkg:pypi/terminado@0.13.0", + "type": "library", + "version": "0.13.0" + }, + { + "name": "urllib3", + "properties": [ + { + "name": "cachi2:found_by", + "value": "cachi2" + } + ], + "purl": "pkg:pypi/urllib3@2.0.1", + "type": "library", + "version": "2.0.1" + } + ], + "metadata": { + "tools": [ + { + "name": "cachi2", + "vendor": "red hat" + } + ] + }, + "specVersion": "1.4", + "version": 1 +} diff --git a/tests/integration/test_data/pip_yanked/fetch_deps_sha256sums.json b/tests/integration/test_data/pip_yanked/fetch_deps_sha256sums.json new file mode 100644 index 000000000..2f81a6329 --- /dev/null +++ b/tests/integration/test_data/pip_yanked/fetch_deps_sha256sums.json @@ -0,0 +1,5 @@ +{ + "pip/black-21.11b0.tar.gz": "sha256:83f3852301c8dcb229e9c444dd79f573c8d31c7c2dad9bbaaa94c808630e32aa", + "pip/terminado-0.13.0.tar.gz": "sha256:713531ccb5db7d4f544651f14050da79809030f00d1afa21462088cf32fb143a", + "pip/urllib3-2.0.1.tar.gz": "sha256:2ce66a68134be469f5df5d46d724237489b3cd85b2bba2223dbbee1746548826" +} diff --git a/tests/integration/test_pip.py b/tests/integration/test_pip.py index 33862e272..1bf34da95 100644 --- a/tests/integration/test_pip.py +++ b/tests/integration/test_pip.py @@ -85,6 +85,17 @@ ), id="pip_no_metadata", ), + pytest.param( + utils.TestParameters( + repo="https://github.com/cachito-testing/cachi2-pip-extra.git", + ref="5f4d168cd573712e56914c326d5f7eff488d7f32", + packages=({"path": ".", "type": "pip"},), + check_vendor_checksums=False, + expected_exit_code=0, + expected_output="All dependencies fetched successfully", + ), + id="pip_yanked", + ), ], ) def test_pip_packages(