Fix parallel smoke test: stub do_action for the run-completed hook#398
Merged
Conversation
workflow-parallel-smoke.php defines its own inline WordPress stubs and had add_filter/apply_filters/add_action but not do_action. The runner now fires do_action( 'wp_agent_workflow_run_completed', ... ) at the terminal funnel, so run() under this stub set hit "Call to undefined function do_action()" and the test fataled (exit 255). Add the missing do_action stub — it dispatches the callbacks registered via the add_action/add_filter stubs — so the completion hook fires in the test the same way it does under WordPress. Production code is unaffected; only the test harness lacked the stub. ## AI assistance - **AI assistance:** Yes - **Tool(s):** Claude Opus 4.8 via Claude Code - **Used for:** Diagnosing the missing-stub CI failure and adding the do_action stub.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#397 added
do_action( 'wp_agent_workflow_run_completed', … )at the runner's terminal funnel.tests/workflow-parallel-smoke.phpdefines its own inline WordPress stubs but only hadadd_filter/apply_filters/add_action— notdo_action— sorun()under those stubs hit "Call to undefined function do_action()" and the smoke job fataled (exit 255). This adds the missingdo_actionstub (dispatching callbacks registered via the existingadd_action/add_filterstubs).Production code is correct — WordPress provides
do_action; only this test's harness lacked the stub. All workflow smoke tests pass locally after the fix.Fixes the
PHP smoke testsfailure introduced by #397.AI assistance