test(generators): cover translator and queue policies#445
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 generator behavior and coverage for message translator, priority queue, and queue load leveling generators, especially around nested hosts and unresolved type arguments.
Changes:
- Adds
TypeKind.Errorhandling to skip generation when attribute type arguments are unresolved. - Emits nested containing partial type declarations for the three generators.
- Adds TinyBDD-based tests for nested hosts, invalid config/signatures, escaped/default values, and malformed type arguments.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/PatternKit.Generators/Messaging/MessageTranslatorGenerator.cs |
Adds malformed type skip logic and nested host source emission. |
src/PatternKit.Generators/PriorityQueue/PriorityQueueGenerator.cs |
Adds malformed type skip logic and nested host source emission. |
src/PatternKit.Generators/QueueLoadLeveling/QueueLoadLevelingPolicyGenerator.cs |
Adds malformed type skip logic and nested host source emission. |
test/PatternKit.Generators.Tests/MessageTranslatorGeneratorTests.cs |
Converts tests to TinyBDD scenarios and adds expanded generator coverage. |
test/PatternKit.Generators.Tests/PriorityQueueGeneratorTests.cs |
Adds nested-host and malformed-type coverage. |
test/PatternKit.Generators.Tests/QueueLoadLevelingPolicyGeneratorTests.cs |
Adds invalid config, nested-host, and malformed-type coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sb.Append("abstract "); | ||
| else if (type.IsSealed && type.TypeKind == TypeKind.Class) | ||
| sb.Append("sealed "); | ||
| sb.Append("partial ").Append(type.TypeKind == TypeKind.Struct ? "struct" : "class").Append(' ').Append(type.Name).AppendLine(); |
| sb.Append("abstract "); | ||
| else if (type.IsSealed && type.TypeKind == TypeKind.Class) | ||
| sb.Append("sealed "); | ||
| sb.Append("partial ").Append(type.TypeKind == TypeKind.Struct ? "struct" : "class").Append(' ').Append(type.Name).AppendLine(); |
| sb.Append("abstract "); | ||
| else if (type.IsSealed && type.TypeKind == TypeKind.Class) | ||
| sb.Append("sealed "); | ||
| sb.Append("partial ").Append(type.TypeKind == TypeKind.Struct ? "struct" : "class").Append(' ').Append(type.Name).AppendLine(); |
Code Coverage |
Test Results 12 files 12 suites 11m 7s ⏱️ Results for commit 5edae36. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #445 +/- ##
==========================================
+ Coverage 91.49% 96.77% +5.28%
==========================================
Files 551 551
Lines 44900 44988 +88
Branches 6470 6485 +15
==========================================
+ Hits 41082 43539 +2457
+ Misses 1549 1449 -100
+ Partials 2269 0 -2269
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. |
Summary
Validation
Generator coverage after slice: PatternKit.Generators 97.1%; MessageTranslatorGenerator 97.2%; PriorityQueueGenerator 96.5%; QueueLoadLevelingPolicyGenerator 96.1%.