Conversation
…ization pipeline Extract composite normalize helpers from the two-step normalizeContainerPins(normalizeHeredocDelimiters(...)) calls introduced in #25750. - Go: adds normalizeOutput(string) string in wasm_golden_test.go - JS: adds normalize(content) in scripts/test-wasm-golden.mjs Both helpers apply all normalization steps (heredoc delimiters + container pins) in one place, making future additions easier and reducing duplication. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Refactors the WASM golden-test normalization pipeline by introducing small composite helpers that apply the existing normalization steps in one place, reducing duplication while preserving behavior.
Changes:
- Add
normalizeOutput()helper in Go WASM golden tests to compose heredoc + container-pin normalization. - Add
normalize()helper in the Node.js WASM golden test script to compose the same normalization steps. - Update call sites to use the new helpers instead of nested normalization calls.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/wasm_golden_test.go | Introduces normalizeOutput() and uses it for golden comparisons to centralize normalization. |
| scripts/test-wasm-golden.mjs | Introduces normalize() and uses it for comparing WASM output to Go-generated goldens. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
🧪 Test Quality Sentinel ReportTest Quality Score: 100/100✅ Excellent test quality
Test Classification Details
Analysis SummaryThis PR is a pure refactoring — no new test functions were added. The changes consolidate repeated normalization pipelines into helper functions:
The modified No new test functions → no regressions introduced. Build tag Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators.
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 100/100. Test quality is acceptable — 0% of modified tests are implementation tests (threshold: 30%). This is a pure refactoring PR that adds helper functions to consolidate the normalization pipeline; no behavioral changes to test logic.
This PR simplifies code from the last 24 hours, specifically from #25750 which added
normalizeContainerPins().Files Simplified
pkg/workflow/wasm_golden_test.go— extractednormalizeOutput()helperscripts/test-wasm-golden.mjs— extractednormalize()helperImprovements Made
Reduced Duplication
Both files called the two-step normalization chain in multiple places:
After — composite helpers
Benefits:
normalizeOutputvs nested calls)Changes Based On
Testing
go test -run "TestWasmGolden_CompileFixtures" ./pkg/workflow/— PASSgo vetcleanReview Focus
Please verify:
Automated by Code Simplifier Agent — analyzing code from the last 24 hours