test(generators): cover leader election and bff#436
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
This PR expands source-generator test coverage for the Leader Election and Backends-for-Frontends generators while adding generator emission support for nested (non-top-level) host types via containing-type wrapper generation, aligning with issue #413’s goal of raising local generator coverage toward ~99%.
Changes:
- Added extensive TinyBDD/xUnit theory coverage for invalid declarations, defaults, escaped names, malformed type arguments, and nested host shapes.
- Updated
LeaderElectionGeneratorandBackendsForFrontendsGeneratorto emit generated code inside the correct containing-type nesting structure. - Added “skip generation” tests for null/malformed attribute type arguments.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/PatternKit.Generators.Tests/LeaderElectionGeneratorTests.cs | Expands scenarios to cover invalid signatures/config, default host shapes, nested hosts, and malformed type args. |
| test/PatternKit.Generators.Tests/BackendsForFrontendsGeneratorTests.cs | Expands scenarios to cover invalid declarations, default host shapes, nested hosts, and malformed type args. |
| src/PatternKit.Generators/LeaderElection/LeaderElectionGenerator.cs | Adds containing-type wrapper emission so generated factories land in the correct nested host type. |
| src/PatternKit.Generators/BackendsForFrontends/BackendsForFrontendsGenerator.cs | Adds containing-type wrapper emission so generated factories land in the correct nested host type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var containingTypes = GetContainingTypes(type); | ||
| var indentLevel = 0; | ||
| foreach (var containingType in containingTypes) | ||
| { | ||
| AppendTypeDeclaration(sb, containingType, indentLevel); |
| var containingTypes = GetContainingTypes(type); | ||
| var indentLevel = 0; | ||
| foreach (var containingType in containingTypes) | ||
| { | ||
| AppendTypeDeclaration(sb, containingType, indentLevel); |
Test Results 12 files 12 suites 7m 43s ⏱️ Results for commit 9cff716. |
🔍 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #436 +/- ##
==========================================
+ Coverage 90.75% 96.39% +5.64%
==========================================
Files 551 551
Lines 44547 44587 +40
Branches 6414 6420 +6
==========================================
+ Hits 40428 42981 +2553
+ Misses 1735 1606 -129
+ Partials 2384 0 -2384
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:
|
Code Coverage |
Summary
Validation
LeaderElectionGeneratorTests|FullyQualifiedNameBackendsForFrontendsGeneratorTests" --logger "console;verbosity=minimal"Coverage
Refs #413