recipe release testing cleanup insufficient #768

Open
opened 2026-02-13 15:42:25 +00:00 by iexos · 1 comment
Member

While working on a recipe release test I noticed that the test recipe was initially on a detached head if running the test isolated but on main branch if running the whole file, making the test fail in one case and succeed in the other. needless to say, this should not happen as it adds confusion

While working [on a recipe release test](https://git.coopcloud.tech/toolshed/abra/src/commit/23268a0e9251df9db89f6fc31979fb5c7b8c74bd/tests/integration/recipe_release.bats#L116) I noticed that the test recipe was initially on a detached head if running the test isolated but on main branch if running the whole file, making the test fail in one case and succeed in the other. needless to say, this should not happen as it adds confusion
iexos added the
test
label 2026-02-13 15:42:25 +00:00
decentral1se changed title from recipe testing cleanup insufficient to test: `recipe release` testing cleanup insufficient 2026-02-13 15:57:44 +00:00
decentral1se changed title from test: `recipe release` testing cleanup insufficient to `recipe release` testing cleanup insufficient 2026-02-13 15:57:53 +00:00
Owner

@iexos

Yes, I have struggled with this. In general, a simple solution is to use the per-file global teardown() function to ensure that things get cleaned up. The nuclear approach is usually to go with:

_reset_recipe(){
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
assert_success
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
_fetch_recipe
}

There are some other helpers in there, you'll know which one fits your situation best.

@iexos Yes, I have struggled with this. In general, a simple solution is to use the per-file global `teardown()` function to ensure that things get cleaned up. The nuclear approach is usually to go with: https://git.coopcloud.tech/toolshed/abra/src/commit/2c5a273fa77fac01eeebdc48b197a8c52ea235d3/tests/integration/helpers/recipe.bash#L17-L23 There are some other helpers in there, you'll know which one fits your situation best.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#768
No description provided.