test: cover facade generator edge cases#422
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 strengthens FacadeGenerator edge-case handling and increases generator source coverage by adding TinyBDD scenarios, while adjusting contract-first method emission to keep generated signatures faithful to the declared contract when ForceAsync is enabled.
Changes:
- Added multiple new
FacadeGeneratorTinyBDD scenarios covering signature-matching failures, missing-map stub emission withForceAsync, dependency field-name collisions, and nullable/struct generic constraints. - Updated contract-first facade method generation to not treat
ForceAsyncas changing the contract method’s async-ness (preventing invalid interface implementations).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/PatternKit.Generators.Tests/FacadeGeneratorTests.cs | Adds new scenarios to cover additional generator branches and edge cases (contract-first and auto-facade). |
| src/PatternKit.Generators/FacadeGenerator.cs | Adjusts contract-first method signature generation so ForceAsync does not alter async detection for contract methods. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var diagnostics = run.Results.SelectMany(r => r.Diagnostics).ToArray(); | ||
| ScenarioExpect.All(diagnostics, d => ScenarioExpect.Equal("PKFCD004", d.Id)); |
Code Coverage |
Test Results 12 files 12 suites 10m 27s ⏱️ Results for commit 9a7bd0d. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #422 +/- ##
==========================================
+ Coverage 89.95% 95.93% +5.97%
==========================================
Files 551 551
Lines 44186 44186
Branches 6359 6358 -1
==========================================
+ Hits 39746 42388 +2642
+ Misses 1948 1798 -150
+ Partials 2492 0 -2492
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
Part of #413.
Validation
Note:
dotnet test PatternKit.slnx --configuration Release --no-restore --no-build -p:TestTfmsInParallel=false -m:1 --logger "console;verbosity=minimal"timed out locally while stuck in thePatternKit.Testsnet8 vstest process; that assembly passed immediately when run directly. CI remains the full-suite gate.