test: add tests for artifact URL mapping in processMessages#26118
test: add tests for artifact URL mapping in processMessages#26118
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/e3f83b00-81f8-4186-a117-4b83f2ce1e13 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds missing test coverage for artifact temporary-ID (#aw_*) to artifact URL mapping and resolution behavior within processMessages, ensuring the safe output handler manager properly tracks unresolved references and pre-resolves bodies when possible.
Changes:
- Adds a test that
artifactUrlMapis populated after a successfulupload_artifact. - Adds a test ensuring outputs created before an artifact upload (but referencing it) are tracked in
outputsWithUnresolvedIds. - Adds a test ensuring outputs created after an artifact upload have
#aw_*references replaced in the handler input body.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/safe_output_handler_manager.test.cjs | Adds tests validating artifact URL map population, unresolved-reference tracking, and pre-resolution of artifact references in message bodies. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
🧪 Test Quality Sentinel ReportTest Quality Score: 80/100✅ Excellent test quality
Test Classification Details
Score Breakdown
Test Classification DetailsAll three tests cover behavioral contracts for Test 1 — Test 2 — Test 3 — Minor SuggestionTest 1 could be strengthened by adding one error-path case (e.g., what happens when the 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.
|
The CI for PR #26108 (
copilot/validate-temporary-ids-urls) failed with a TypeScript typecheck error:Root cause: The
processSyntheticUpdatesfunction hadartifactUrlMapas an optional JSDoc parameter ([artifactUrlMap]), making its typeMap<string, string> | undefined. ThereplaceArtifactUrlReferencesfunction intemporary_id.cjsonly acceptedMap<string, string>, so passing the optional parameter caused a TypeScript error.Fix (already in main): The JSDoc for
replaceArtifactUrlReferenceswas updated to@param {Map<string, string>|null|undefined} artifactUrlMap, matching the function's actual runtime behavior (it handlesundefinedinternally).This PR adds test coverage for the artifact URL mapping feature introduced by PR #26108, which was missing from
safe_output_handler_manager.test.cjs:artifactUrlMapis populated in the result whenupload_artifactsucceedsoutputsWithUnresolvedIdswhen the artifact is uploaded after