Skip to content

test: improve generator coverage#500

Merged
JerrettDavis merged 1 commit into
mainfrom
feature/source-generator-coverage-413
Jun 1, 2026
Merged

test: improve generator coverage#500
JerrettDavis merged 1 commit into
mainfrom
feature/source-generator-coverage-413

Conversation

@JerrettDavis
Copy link
Copy Markdown
Owner

Closes #413

Summary

  • adds CompensatingTransactionGenerator edge coverage for malformed context types, host shapes, accessibility, and escaped emitted names
  • expands DecoratorGenerator coverage for inaccessible protected properties, accessor-level getter modifiers, nullable/default literals, enum named defaults, and floating-point special values

Local coverage delta

  • PatternKit.Generators generator-only report remains 98.1% line coverage due rounding, uncovered lines drop from 409 to 392
  • CompensatingTransactionGenerator moves from 94.5% to 99.3%
  • DecoratorGenerator moves from 95.4% to 96.9%

Validation

  • dotnet build PatternKit.slnx --configuration Release --no-restore -p:UseSharedCompilation=false
  • dotnet test test\PatternKit.Generators.Tests\PatternKit.Generators.Tests.csproj --configuration Release --no-build --framework net8.0
  • dotnet format PatternKit.slnx --verify-no-changes --verbosity minimal
  • git diff --check
  • generator-only coverage: 98.1% line coverage, 392 uncovered lines

Copilot AI review requested due to automatic review settings June 1, 2026 14:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions Bot added the size/m label Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR increases unit test coverage for the source generators—specifically expanding scenario coverage for the CompensatingTransactionGenerator and DecoratorGenerator to exercise additional edge cases (type shapes/accessibility and emitted literal/name escaping).

Changes:

  • Added DecoratorGenerator tests for inaccessible protected members and for preserving additional default literal forms (nullable/default/null, enum named defaults, floating-point special values).
  • Added CompensatingTransactionGenerator tests covering additional host type shapes/accessibilities and string escaping in generated output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/PatternKit.Generators.Tests/DecoratorGeneratorTests.cs Adds scenarios for PKDEC004 (inaccessible protected property) and expands literal/default-value emission assertions.
test/PatternKit.Generators.Tests/CompensatingTransactionGeneratorTests.cs Adds scenarios validating generation across multiple host shapes/accessibilities and escaped names in emitted code.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/PatternKit.Generators.Tests/DecoratorGeneratorTests.cs Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Test Results

    12 files      12 suites   12m 20s ⏱️
 4 197 tests  4 197 ✅ 0 💤 0 ❌
13 043 runs  13 043 ✅ 0 💤 0 ❌

Results for commit f1cee65.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.44%. Comparing base (6852e8b) to head (f1cee65).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #500      +/-   ##
==========================================
+ Coverage   97.40%   97.44%   +0.03%     
==========================================
  Files         611      611              
  Lines       49926    49926              
  Branches     3230       34    -3196     
==========================================
+ Hits        48631    48650      +19     
+ Misses       1295     1276      -19     
Flag Coverage Δ
unittests 97.44% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

🔍 PR Validation Results

Version: ``

✅ Validation Steps

  • Build solution
  • Run tests
  • Build documentation
  • Dry-run NuGet packaging

📊 Artifacts

Dry-run artifacts have been uploaded and will be available for 7 days.


This comment was automatically generated by the PR validation workflow.

@JerrettDavis JerrettDavis force-pushed the feature/source-generator-coverage-413 branch from e38fb20 to f1cee65 Compare June 1, 2026 15:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Code Coverage

Summary
  Generated on: 06/01/2026 - 15:24:45
  Coverage date: 06/01/2026 - 15:22:48 - 06/01/2026 - 15:24:33
  Parser: MultiReport (8x Cobertura)
  Assemblies: 5
  Classes: 1817
  Files: 611
  Line coverage: 97.4%
  Covered lines: 48648
  Uncovered lines: 1278
  Coverable lines: 49926
  Total lines: 105800
  Branch coverage: 84.4% (15614 of 18483)
  Covered branches: 15614
  Total branches: 18483
  Method coverage: 97.3% (9510 of 9772)
  Full method coverage: 91.6% (8960 of 9772)
  Covered methods: 9510
  Fully covered methods: 8960
  Total methods: 9772

PatternKit.Core                                                                                                     96.2%
  PatternKit.Application.ActivityTracking.ActivityGateState                                                          100%
  PatternKit.Application.ActivityTracking.ActivityLease                                                              100%
  PatternKit.Application.ActivityTracking.ActivityRecord                                                             100%
  PatternKit.Application.ActivityTracking.ActivityTracker                                                            100%
  PatternKit.Application.Aggregates.AggregateCommandHandler<T1, T2, T3>                                              100%
  PatternKit.Application.Aggregates.AggregateCommandResult<T>                                                        100%
  PatternKit.Application.Aggregates.AggregateRoot<T1, T2>                                                            100%
  PatternKit.Application.AntiCorruption.AntiCorruptionLayer<T1, T2>                                                 90.4%
  PatternKit.Application.AntiCorruption.AntiCorruptionResult<T>                                                      100%
  PatternKit.Application.AuditLog.AuditLogAppendResult<T>                                                           85.7%
  PatternKit.Application.AuditLog.InMemoryAuditLog<T1, T2>                                                          95.4%
  PatternKit.Application.BoundedContexts.BoundedContextAdapter                                                       100%
  PatternKit.Application.BoundedContexts.BoundedContextCapability                                                   83.3%
  PatternKit.Application.BoundedContexts.BoundedContextDescriptor                                                   95.4%
  PatternKit.Application.CompensatingTransactions.CompensatingTransaction<T>                                        96.9%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionExecution<T>                                100%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionRecord                                      100%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionStep<T>                                     100%
  PatternKit.Application.CompensatingTransactions.CompensatingTransactionStepBuilder<T>                              100%
  PatternKit.Application.ContextMaps.ContextMapDescriptor                                                           96.8%
  PatternKit.Application.ContextMaps.ContextMapRelationship                                                          100%
  PatternKit.Application.DataMapping.DataMapper<T1, T2>                                                             94.6%
  PatternKit.Application.DataMapping.DataMapperError                                                                  90%
  PatternKit.Application.DataMapping.DataMapperResult<T>                                                            84.6%
  PatternKit.Application.DomainEvents.DomainEventDispatcher<T>                                                      95.4%
  PatternKit.Application.DomainEvents.DomainEventDispatchResult                                                      100%
  PatternKit.Application.DomainServices.DomainServiceOperation<T1, T2>                                               100%
  PatternKit.Application.DomainServices.DomainServiceRegistry<T1, T2>                                                100%
  PatternKit.Application.EventSourcing.EventStoreAppendResult                                                        100%
  PatternKit.Application.EventSourcing.InMemoryEventStore<T1, T2>                                                   97.9%
  PatternKit.Application.EventSourcing.StoredEvent<T1, T2>                                                            80%
  PatternKit.Application.EventualConsistency.EventualConsistencyEvaluation<T>                                       92.3%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitor<T>                                          97.2%
  PatternKit.Application.EventualConsistency.EventualConsistencyMonitorState<T>                                      100%
  PatternKit.Application.EventualConsistency.EventualConsistencyWatermarks<T>                                       96.7%
  PatternKit.Application.FeatureToggles.FeatureToggleDecision                                                       87.5%
  PatternKit.Application.FeatureToggles.FeatureToggleRule<T>                                                         100%
  PatternKit.Application.FeatureToggles.FeatureToggleSet<T>                                                         96.9%

@JerrettDavis JerrettDavis merged commit cb29b75 into main Jun 1, 2026
12 checks passed
@JerrettDavis JerrettDavis deleted the feature/source-generator-coverage-413 branch June 1, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Raise source-generator coverage toward 99%

2 participants