test(generators): cover feature toggles and gateway aggregation#440
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Hardens the Feature Toggle Set and Gateway Aggregation source generators so that hosts declared inside containing partial types are emitted with the necessary wrapping declarations, and expands TinyBDD generator scenarios to cover defaults, escaped names, nested host shapes, malformed Type arguments, and additional invalid signatures. The changes target the source-generator coverage push tracked in #413.
Changes:
- In both
FeatureToggleSetGeneratorandGatewayAggregationGenerator, emit wrappingpartialdeclarations for eachContainingType(with the correct accessibility/indentation) before emitting the host's factory body, and close them in reverse order. - Convert the existing diagnostic tests to
[Theory]form and add cases forPKFT003(no/wrong context parameter) and additionalPKGA003/PKGA004signature variants. - Add scenarios asserting generated output for default names, escaped configured names, multiple host shapes (
internal abstract,public sealed,internal struct), nested host wrappers across all accessibilities, and skipping when constructorTypearguments are null.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/PatternKit.Generators/FeatureToggles/FeatureToggleSetGenerator.cs | Emits containing-type partial wrappers around the generated factory and refactors AppendTypeDeclaration to accept an indent level. |
| src/PatternKit.Generators/GatewayAggregation/GatewayAggregationGenerator.cs | Mirrors the feature-toggle change: wraps containing partial types and reuses indent-aware helpers for the gateway factory body. |
| test/PatternKit.Generators.Tests/FeatureToggleSetGeneratorTests.cs | Adds theory cases for new PKFT003 shapes and scenarios for defaults/host shapes, nested wrappers, and malformed context type. |
| test/PatternKit.Generators.Tests/GatewayAggregationGeneratorTests.cs | Converts invalid-declaration scenario to a theory and adds defaults/host shapes, nested wrappers, and malformed-type-argument scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results 12 files 12 suites 10m 34s ⏱️ Results for commit 98183b6. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #440 +/- ##
==========================================
+ Coverage 91.13% 96.57% +5.44%
==========================================
Files 551 551
Lines 44723 44763 +40
Branches 6442 6448 +6
==========================================
+ Hits 40757 43229 +2472
+ Misses 1638 1534 -104
+ Partials 2328 0 -2328
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 PR Validation ResultsVersion: `` ✅ Validation Steps
📊 ArtifactsDry-run artifacts have been uploaded and will be available for 7 days. This comment was automatically generated by the PR validation workflow. |
Code Coverage |
Summary
Validation
Refs #413