test: add run_plugn_trigger and run_plugin_script bats helpers

Both helpers wrap `run /bin/bash -c "..."` with the env vars dokku plugin scripts and `plugn` need, replacing the long inline boilerplate that was duplicated across `tests/unit/resource_3.bats` and the new `core-post-extract` regression tests in the builder bats files.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-07 12:47:00 -04:00
parent eb17a383c6
commit bc8adfa6e2
7 changed files with 35 additions and 12 deletions

View File

@@ -163,7 +163,7 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "PLUGIN_PATH=$PLUGIN_PATH PLUGIN_AVAILABLE_PATH=$PLUGIN_AVAILABLE_PATH PLUGIN_ENABLED_PATH=$PLUGIN_ENABLED_PATH PLUGIN_CORE_AVAILABLE_PATH=$PLUGIN_CORE_AVAILABLE_PATH DOKKU_LIB_ROOT=$DOKKU_LIB_ROOT $PLUGIN_ENABLED_PATH/builder-lambda/core-post-extract $TEST_APP $TMP_DIR HEAD"
run_plugin_script builder-lambda core-post-extract "$TEST_APP" "$TMP_DIR" HEAD
echo "output: $output"
echo "status: $status"
assert_success