Repository navigation
test: add workflow step replay helper - #1964
Merged
Merged
Conversation
gerchowl
force-pushed
the
feature/1963-workflow-step-replay
branch
from
October 29, 2026 08:38
175b277 to
48ea8d5
Compare
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.
Description
Add a small workflow replay helper so consumer-matrix tests can execute workflow scripts with evaluated env and conditions, isolated shells, and real output/environment propagation.
Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance taskrefactor-- Code restructuringtest-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code styleModifiers
!)Changes Made
tests.workflow_replay.Replayand a JSON CLI with explicit step selection and seeded context for external boundaries.stepsandenvcontext roots.1.18.0before devkit project tests: checkout is shallow, and the real pre-N workflow test intentionally fails if the tag is absent. This step is limited to the pytest suite; consumer workflows and S8 cells are untouched.Diff map
tests/github_expression.pyand its tests: acceptstepsandenvroots with the existing case-insensitive lookup and ambiguity checks.tests/workflow_replay.py,_file_values: strict UTF-8 command-file decoding, LF-only parsing, multiline values and malformed-entry errors.Replay.resolve_env/ validation: env precedence, literal workspace-relative working directories, and explicit refusals of unsupported step/job fields.Replay.run/ execution / result handling: Linux implicit vs explicit bash defaults, isolated scripts, step outputs/outcome/conclusion, replacement of seeded replayed ids, and context-derived default variables.tests/test_workflow_replay.py: behavioral contracts, runner-source citations, real tag env resolution, mutations, byte-level regressions, CLI and failure cases..github/actions/test-project/action.yml: fetch only the required historical tag before project pytest runs.Changelog Entry
No changelog needed: internal test infrastructure. The earlier entries in both root and generated devcontainer changelogs have been removed.
Testing
just test) — full suite delegated to CI per task instructions.Manual Testing Details
TDD tests committed before implementation. Initial helper RED exited 1. Fix-round RED (commit
956372bc) exited 1: 19 failed, 196 passed. GREEN:uv run --with pytest-xdist pytest tests/test_workflow_replay.py tests/test_github_expression.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1963-r4b-green— 215 passed, exit 0.Tests cover both shell-default paths and workflow/job defaults; success/failure/skipped results; replacement of stale seeded outputs; Linux CR and strict UTF-8 handling; rejected job fields and invalid run types; literal/expression working directories; default runner env; and visibility of own step env in its condition. StepsRunner.cs confirms that env evaluation precedes step condition evaluation, which the helper already did correctly.
Hooks run inside
nix develop. The targeted CI fetch is configuration, so no separate TDD cycle applies.CI on
48ea8d5eeb08fe07acd4230c77dcac8236c94f67: all 16 checks passed, including Test Summary. Project Tests ran 3139 tests successfully, including every new regression case. CI run.Checklist
CHANGELOG.md— unnecessary for internal test toolingAdditional Notes
Local composite actions are explicitly refused; S8 currently extracts their run steps directly. Job scheduling and external actions remain unsupported and are refused explicitly. Seeded step context stands in only for external boundaries that are not replayed; replayed ids replace their seeds. Failures stop replay after recording outcome/conclusion in
step_context. PR #1958 will adopt the helper separately.Refs: #1963