test: cover messaging bridge generator hosts#426
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 Messaging Bridge source-generator coverage and updates the generator so nested bridge hosts are emitted inside containing partial wrappers.
Changes:
- Adds TinyBDD/xUnit scenarios for defaults, diagnostics, malformed type args, nested hosts, escaping, and emitted compilation.
- Updates
MessagingBridgeGeneratorto generate wrapper declarations for containing types around nested hosts. - Consolidates test compilation/emission assertions through a shared helper record.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/PatternKit.Generators/Messaging/MessagingBridgeGenerator.cs |
Adds nested containing-type wrapper emission for generated bridge hosts. |
test/PatternKit.Generators.Tests/MessagingBridgeGeneratorTests.cs |
Expands Messaging Bridge generator scenarios and verifies generated sources emit successfully. |
💡 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); |
| sb.Append(" => global::PatternKit.Messaging.Bridges.MessagingBridge<").Append(inbound).Append(", ").Append(outbound).Append(">.Create(").Append(ToLiteral(bridgeName)).AppendLine(");"); | ||
| sb.AppendLine("}"); | ||
| return sb.ToString(); | ||
| sb.Append("partial ").Append(type.TypeKind == TypeKind.Struct ? "struct" : "class").Append(' ').Append(type.Name); |
Test Results 12 files 12 suites 10m 50s ⏱️ Results for commit f2c4835. |
Code Coverage |
🔍 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 #426 +/- ##
==========================================
+ Coverage 90.11% 96.00% +5.89%
==========================================
Files 551 551
Lines 44247 44269 +22
Branches 6367 6370 +3
==========================================
+ Hits 39872 42502 +2630
+ Misses 1904 1767 -137
+ Partials 2471 0 -2471
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:
|
Summary:
Coverage:
Validation:
Closes part of #413.