Parent
#355
What to build
Create a RecordingRunner test helper (satisfies the ScriptRunner seam from #362) that captures every script invocation — the script text, the env slice, and the working directory — and can be configured to return controlled errors on specific calls.
Using RecordingRunner, write a comprehensive table-driven test suite against Executor.Execute(). The test file lives in package executor (same package, internal access) and uses only the standard testing library — no third-party assertion frameworks.
Tests to cover:
- Init script runs on the first
Execute() call and is skipped on subsequent calls
- Dependencies execute in declaration order
- A dependency failure returns a
DependencyError with the correct command chain
- Sequential command scripts execute in order
after script is invoked even when the main command script fails
after script error does not override the main command's exit code
- Parallel mode dispatches all command scripts (order-independent)
- A failure in one parallel script causes
Execute() to return an error
LETS_CHECKSUM_* env vars are present in the runner invocation when a checksum is defined
- Checksum is persisted after a successful execution
- Checksum is not persisted when a command script fails
Acceptance criteria
Blocked by
Parent
#355
What to build
Create a
RecordingRunnertest helper (satisfies theScriptRunnerseam from #362) that captures every script invocation — the script text, the env slice, and the working directory — and can be configured to return controlled errors on specific calls.Using
RecordingRunner, write a comprehensive table-driven test suite againstExecutor.Execute(). The test file lives inpackage executor(same package, internal access) and uses only the standardtestinglibrary — no third-party assertion frameworks.Tests to cover:
Execute()call and is skipped on subsequent callsDependencyErrorwith the correct command chainafterscript is invoked even when the main command script failsafterscript error does not override the main command's exit codeExecute()to return an errorLETS_CHECKSUM_*env vars are present in the runner invocation when a checksum is definedAcceptance criteria
RecordingRunnercaptures script, env, and dir per invocation and supports returning controlled errorspackage executor(internal), standardtestinglibrary, no third-party frameworksgo test ./internal/executor/...passesBlocked by