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 committed 2026-05-07 12:47:00 -04:00
1 parent eb17a383c6
commit bc8adfa6e2
7 files changed
+35 -12

No files matched your search

+1 -1
View File
@@ -142,7 +142,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-nixpacks/core-post-extract $TEST_APP $TMP_DIR HEAD"
run_plugin_script builder-nixpacks core-post-extract "$TEST_APP" "$TMP_DIR" HEAD
echo "output: $output"
echo "status: $status"
assert_success