test: cover ambassador and canonical data model generators#434
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 extends Ambassador and Canonical Data Model source generators to emit partial wrappers for nested hosts, and expands generator test coverage for diagnostics, host shapes, escaping, malformed type arguments, and emitted compilation.
Changes:
- Adds containing partial type wrapper generation for nested Ambassador and Canonical Data Model hosts.
- Refactors invalid declaration tests into parameterized TinyBDD theories.
- Adds tests for host shape preservation, nested wrappers, string escaping, and malformed type arguments.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/PatternKit.Generators/Ambassador/AmbassadorGenerator.cs |
Adds nested containing-type wrapper emission for Ambassador generated sources. |
src/PatternKit.Generators/CanonicalDataModel/CanonicalDataModelGenerator.cs |
Adds nested containing-type wrapper emission for Canonical Data Model generated sources. |
test/PatternKit.Generators.Tests/AmbassadorGeneratorTests.cs |
Expands Ambassador generator diagnostics and generated source coverage. |
test/PatternKit.Generators.Tests/CanonicalDataModelGeneratorTests.cs |
Expands Canonical Data Model generator diagnostics and generated source 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); |
| sb.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 6m 19s ⏱️ Results for commit b8f79b9. |
🔍 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 #434 +/- ##
==========================================
+ Coverage 90.53% 96.27% +5.74%
==========================================
Files 551 551
Lines 44465 44507 +42
Branches 6402 6408 +6
==========================================
+ Hits 40256 42851 +2595
+ Misses 1789 1656 -133
+ Partials 2420 0 -2420
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
AmbassadorGeneratorTests|FullyQualifiedNameCanonicalDataModelGeneratorTests" --logger "console;verbosity=minimal"Coverage: AmbassadorGenerator 99.4%; CanonicalDataModelGenerator 99.1%; PatternKit.Generators 95.8% locally.