test(core): add regression coverage for multi-tag operation dedup (#873) - #3377
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a regression test for issue ChangesMulti-tag Operation Regression Test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What this PR does
Adds a focused regression test for #873.
#873 reports that an operation declaring multiple tags (e.g.
tags: [cats, dogs]) was generated and exposed once per tag intags/tags-splitmode, which duplicated the operation across tag files and made the workspaceindex.tsre-export the same symbol twice and fail to compile.This behaviour is already fixed on
master:generateTargetForTagsbuckets each operation by its first tag only (packages/core/src/writers/target-tags.ts). The existingtests/specifications/multiple-tags.yamlfixture (listPetshastags: [cats, dogs]) already exercises this path, but it is only covered by the broad file snapshots, so a regression would surface as an opaque snapshot diff rather than a clear signal.This PR pins the behaviour explicitly, matching the existing focused-test pattern in
tests/api-generation.spec.ts(see the #708 / #826 / #3103 tests): the test asserts thatlistPetsis emitted under its first tag (cats) and is not duplicated into a later tag (dogs), for bothtagsandtags-splitmodes.Why
The duplication bug is fixed but had no targeted coverage. If the first-tag dedup logic regresses, this test fails with a clear message (
listPets must not be duplicated into a later tag) instead of a full-file snapshot diff.Verification
master.tests/api-generation.spec.tsis touched.format:check,typecheck,lint,test,test:snapshots, and the generated-client typecheck (--filter orval-tests build) all pass.Summary by CodeRabbit