-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix corrupted package cache for outputs in subpackage tests (#5184)
* Add test recipe outputs_overwrite_base_file * Fix corrupted package cache for outputs in subpackage tests This re-introduces `conda_build.environ.clean_pkg_cache` with slight changes to not use `conda.models.dist.Dist` and handle multiple `pkgs_dirs` better. --------- Signed-off-by: Marcel Bargull <[email protected]>
- Loading branch information
Showing
6 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### Enhancements | ||
|
||
* <news item> | ||
|
||
### Bug fixes | ||
|
||
* Fix corrupted package cache for outputs in subpackage tests. (#5184) | ||
|
||
### Deprecations | ||
|
||
* <news item> | ||
|
||
### Docs | ||
|
||
* <news item> | ||
|
||
### Other | ||
|
||
* <news item> |
2 changes: 2 additions & 0 deletions
2
tests/test-recipes/metadata/outputs_overwrite_base_file/install.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
:: Always output 4 characters to properly test even if "SafetyError: ... incorrect size." is not triggered. | ||
< nul set /p="%PKG_NAME:~0,4%" > "%PREFIX%\file" & call; |
2 changes: 2 additions & 0 deletions
2
tests/test-recipes/metadata/outputs_overwrite_base_file/install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## Always output 4 characters to properly test even if "SafetyError: ... incorrect size." is not triggered. | ||
printf '%.4s' "${PKG_NAME}" > "${PREFIX}/file" |
40 changes: 40 additions & 0 deletions
40
tests/test-recipes/metadata/outputs_overwrite_base_file/meta.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% set name = "outputs_overwrite_base_file" %} | ||
|
||
package: | ||
name: {{ name }} | ||
version: 1.0 | ||
|
||
outputs: | ||
- name: base-{{ name }} | ||
script: install.sh # [unix] | ||
script: install.bat # [win] | ||
|
||
- name: first-{{ name }} | ||
script: install.sh # [unix] | ||
script: install.bat # [win] | ||
requirements: | ||
host: | ||
- {{ pin_subpackage("base-" + name) }} | ||
run: | ||
- {{ pin_subpackage("base-" + name) }} | ||
test: | ||
commands: | ||
- content="$(cat "${PREFIX}/file")" # [unix] | ||
- test "${content}" = base # [unix] | ||
- < "%PREFIX%\file%" set /p content= # [win] | ||
- if not "%content%" == "base" exit 1 # [win] | ||
|
||
- name: second-{{ name }} | ||
script: install.sh # [unix] | ||
script: install.bat # [win] | ||
requirements: | ||
host: | ||
- {{ pin_subpackage("base-" + name) }} | ||
run: | ||
- {{ pin_subpackage("base-" + name) }} | ||
test: | ||
commands: | ||
- content="$(cat "${PREFIX}/file")" # [unix] | ||
- test "${content}" = "base" # [unix] | ||
- < "%PREFIX%\file%" set /p content= # [win] | ||
- if not "%content%" == "base" exit 1 # [win] |