Repository navigation
test(validation): cover ValidationWorkflowService.combineValidation - #8604
Conversation
combineValidation is what turns per-check results into the single
verdict the workflow editor acts on, and it had no direct test.
The cases pin down the three things the implementation decides:
- validity is an AND across all validations, order-independent
- messages are merged only from the validations that failed, so a
stray `messages` on something reporting isValid: true is dropped
- a later failure wins when two failures use the same message key
Two shape details are asserted too, since call sites depend on them: the
valid result omits `messages` entirely rather than returning an empty
map, and the no-argument call is vacuously valid.
Closes apache#6684
Claude-Session: https://claude.ai/code/session_01EeaEYRdhRYWL7ya7w8LJux
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8604 +/- ##
=========================================
Coverage 92.76% 92.76%
Complexity 4897 4897
=========================================
Files 1236 1236
Lines 52155 52163 +8
Branches 6409 6410 +1
=========================================
+ Hits 48380 48391 +11
Misses 2194 2194
+ Partials 1581 1578 -3
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Hi @mengw15 Would you mind having a look at this one when you get a chance? It's test-only, just a few cases covering |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The test-only changes accurately cover the documented behavior without introducing issues.
Review effort: Lite
Findings: None
What changed in this PR
Adds direct unit coverage for ValidationWorkflowService.combineValidation, validating aggregation semantics and edge cases.
Changes:
- Tests validity aggregation and message merging.
- Covers empty inputs, collisions, stray messages, and mutation safety.
| File | Description |
|---|---|
frontend/src/app/workspace/service/validation/validation-workflow.service.spec.ts |
Adds nine focused combineValidation tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
What changes were proposed in this PR?
ValidationWorkflowService.combineValidationis what folds the per-check results (JSON-schema validation and operator-connection validation) into the single verdict the workflow editor acts on:It had no direct test. This PR adds one, covering the three decisions the implementation actually makes:
validation.isValidrather than on themessageskey being absent, so a straymessagesfield on something reportingisValid: trueis dropped rather than leaking into the combined result.Two shape details are asserted as well, because call sites depend on them:
{ isValid }only — it omitsmessagesentirely rather than returning an empty map, so readingmessagesoff a valid result yieldsundefined.No production code is changed; this is a test-only PR.
Any related issues, documentation, discussions?
Closes #6684
How was this PR tested?
Nine cases were added to
validation-workflow.service.spec.tsin a new top-leveldescribe.combineValidationis static, so the block needs noTestBedsetup.messagesisundefined{ isValid: true }messageson a valid validationmessagesis{}npx prettier --checkreports no diff on the changed file.Was this PR authored or co-authored using generative AI tooling?
Yes, partially. I (Suyash Jain) worked on this PR together with Claude Code as a pair-programming assistant. The added specs were run locally against the existing suite before opening this PR.