Skip to content

test: Add 25 WRAP_ACTIONS conformance fixtures for coverage gaps - #157

Open
leongdl wants to merge 1 commit into
OpenJobDescription:mainlinefrom
leongdl:conformance-wrap-actions-gaps
Open

test: Add 25 WRAP_ACTIONS conformance fixtures for coverage gaps#157
leongdl wants to merge 1 commit into
OpenJobDescription:mainlinefrom
leongdl:conformance-wrap-actions-gaps

Conversation

@leongdl

@leongdl leongdl commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

25 WRAP_ACTIONS fixtures closing gaps identified by a systematic coverage audit of RFC 0008 against the existing suite. All 25 validated individually through the conformance runner against openjd-rs; full suite goes 72 → 97 passing, 0 failing.

Areas covered

  • Absent-by-design (new coverage class): host-inherited variables (HOME, PATH, OPENJD_*) must NOT appear in WrappedAction.Environment — pinned with expected.forbidden. Previously a runtime forwarding os.environ wholesale passed every fixture.
  • Macro × emitter matrix: openjd_env emitted by the wrap script itself; by a task grand-child and visible in the next task's WrappedAction.Environment; by a grand-child under onWrapEnvExit; openjd_progress/openjd_status forwarding; stderr forwarding; and the negative control that a wrap script discarding grand-child stdout loses the macro (pins "MUST NOT scan the grand-child directly").
  • Variable scope negatives: WrappedEnv.Name in onWrapTaskRun rejected; WrappedStep.Name in both env hooks rejected; out-of-scope WrappedAction.* buried inside an EXPR function call and inside a let binding — a validator that only walks format strings passes the pre-existing negative and misses these.
  • All-or-nothing rule: the four previously untested invalid hook subsets (enter-only, exit-only, enter+exit, run+exit).
  • Nesting depth 2: two inner envs, WrappedEnv.Name correct per invocation.
  • Nothing-to-replace: a variables:-only inner environment (no script at all) runs no wrap hooks — named in the RFC and schema constraint 5, previously untested.
  • Failure-path breadth: failed onWrapEnvExit → wrapping env's own onExit still runs; grand-child failure under the enter hook propagates; unwrapped-parity control.
  • Positive twin: FEATURE_BUNDLE_1-gated format-string timeout and cancelation.mode on wrap hooks accepted when the extension IS listed (only the reject side existed).

Verification

Every fixture executed via run_openjd_cli_tests.py against openjd-rs. Negatives verified to reject for the exact RFC 0008 rule under test (not an incidental reason). Cross-platform via python -c; no new runOn gates.

Companion PR

Spec-correct fixtures that FAIL against current implementations are in a separate expected-failures PR (branch conformance-wrap-actions-expected-failures) so this one merges green.

25 fixtures closing gaps from the RFC 0008 coverage audit: absent-by-design host vars, macro-by-emitter matrix, stderr forwarding, variable scope negatives (incl. in-expression and in-let variants), the four missing all-or-nothing hook subsets, nesting depth 2, variables-only inner env, failure-path breadth, and the FEATURE_BUNDLE_1-gated fmtstring positive twin. Suite: 72 -> 97 passing. Spec-correct fixtures that FAIL against current implementations are split to the companion branch conformance-wrap-actions-expected-failures.

Signed-off-by: David Leong <116610336+leongdl@users.noreply.github.com>
@leongdl
leongdl requested a review from a team as a code owner August 2, 2026 02:38
@leongdl

leongdl commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

CI note: two fixtures fail on CI but passed local validation against openjd-rs main (wrap-failed-exit-hook-own-onexit-still-runs, wrap-grand-child-fails-under-enter-hook) — likely a released-vs-main CLI version difference or Linux/macOS platform difference; investigating before marking ready. Mainline CI is also currently red for every PR due to two pre-existing broken fixtures unrelated to this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant