From 52272cdc1e00bec3dce9d92a8c5a0eff58ecc28f Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Wed, 2 Oct 2024 18:14:27 +0200 Subject: [PATCH] add test for cache building --- test-data/recipes/cache/recipe-cmake.yaml | 25 +++++++++++++++++++++++ test/end-to-end/test_simple.py | 8 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 test-data/recipes/cache/recipe-cmake.yaml diff --git a/test-data/recipes/cache/recipe-cmake.yaml b/test-data/recipes/cache/recipe-cmake.yaml new file mode 100644 index 000000000..d740ecd62 --- /dev/null +++ b/test-data/recipes/cache/recipe-cmake.yaml @@ -0,0 +1,25 @@ +context: + version: 0.1.0 + build_num: 0 + +recipe: + name: cache-installation + version: ${{ version }} + +build: + number: ${{ build_num }} + +cache: + requirements: + build: + - cmake + build: + script: + - cmake --version + +outputs: + - package: + name: check-1 + + - package: + name: check-2 diff --git a/test/end-to-end/test_simple.py b/test/end-to-end/test_simple.py index d3b3a5dfd..b1d7d8ea9 100644 --- a/test/end-to-end/test_simple.py +++ b/test/end-to-end/test_simple.py @@ -956,3 +956,11 @@ def test_used_vars(rattler_build: RattlerBuild, recipes: Path, tmp_path: Path): assert rendered[0]["build_configuration"]["variant"] == { "target_platform": "noarch" } + +def test_cache_install( + rattler_build: RattlerBuild, recipes: Path, tmp_path: Path, snapshot_json +): + rattler_build.build(recipes / "cache/recipe-cmake.yaml", tmp_path) + + pkg1 = get_extracted_package(tmp_path, "check-1") + pkg2 = get_extracted_package(tmp_path, "check-2")