Skip to content

test: harden proxy generator coverage#480

Merged
JerrettDavis merged 1 commit into
mainfrom
coverage/harden-proxy-generator-413
May 31, 2026
Merged

test: harden proxy generator coverage#480
JerrettDavis merged 1 commit into
mainfrom
coverage/harden-proxy-generator-413

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 31, 2026 17:13
@github-actions

github-actions Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

⚠️ 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 strengthens the Proxy source generator’s coverage by adding regression tests around async suppression, parameter-default edge cases, and void delegation, and adjusts the generator’s delegation logic to honor the effective async mode when interceptors are absent.

Changes:

  • Add generator tests for GenerateAsync = false warning behavior + suppression of async interceptor hooks, reserved context parameter names, dynamic default values, and void delegation behavior.
  • Fix proxy generation so the “no interceptor” fast-path doesn’t emit await/async behavior when async hooks are effectively disabled.
  • Update the Proxy generator documentation and change GenerateProxyAttribute.GenerateAsync’s type.

Reviewed changes

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

File Description
test/PatternKit.Generators.Tests/ProxyGeneratorTests.cs Adds regression tests covering async suppression, reserved context names, dynamic defaults, params, and void delegation.
src/PatternKit.Generators/ProxyGenerator.cs Ensures delegation code uses the same effective async mode as interceptor generation/configuration (prevents incorrect await emission).
src/PatternKit.Generators.Abstractions/Proxy/GenerateProxyAttribute.cs Changes GenerateAsync property type (currently a breaking public API change).
docs/generators/proxy.md Updates GenerateAsync type/docs in the attribute reference table.

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

Comment on lines 74 to 80
/// <summary>
/// Gets or sets whether async interceptor hooks should be generated.
/// If not specified, async support is inferred from the contract
/// (enabled if any member returns Task/ValueTask or has a CancellationToken parameter).
/// </summary>
public bool? GenerateAsync { get; set; }
public bool GenerateAsync { get; set; }

@github-actions

github-actions Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   12m 17s ⏱️
 4 040 tests  4 040 ✅ 0 💤 0 ❌
12 551 runs  12 551 ✅ 0 💤 0 ❌

Results for commit 98d2e6e.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (89ad9a7) to head (98d2e6e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #480      +/-   ##
==========================================
+ Coverage   97.30%   97.47%   +0.16%     
==========================================
  Files         579      579              
  Lines       47191    47161      -30     
  Branches     3076     6767    +3691     
==========================================
+ Hits        45918    45968      +50     
+ Misses       1273     1193      -80     
Flag Coverage Δ
unittests 97.47% <100.00%> (+0.16%) ⬆️

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

github-actions Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

🔍 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 coverage/harden-proxy-generator-413 branch from ff1f79b to 98d2e6e Compare May 31, 2026 17:29
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/31/2026 - 17:37:05
  Coverage date: 05/31/2026 - 17:34:18 - 05/31/2026 - 17:36:52
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1715
  Files: 579
  Line coverage: 97.3%
  Covered lines: 45929
  Uncovered lines: 1232
  Coverable lines: 47161
  Total lines: 100733
  Branch coverage: 84.3% (14555 of 17248)
  Covered branches: 14555
  Total branches: 17248
  Method coverage: 97.2% (8971 of 9227)
  Full method coverage: 91.5% (8448 of 9227)
  Covered methods: 8971
  Fully covered methods: 8448
  Total methods: 9227

PatternKit.Core                                                                                                       96%
  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.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%
  PatternKit.Application.IdentityMap.IdentityMap<T1, T2>                                                             100%
  PatternKit.Application.IdentityMap.IdentityMapResult<T>                                                           92.8%
  PatternKit.Application.ManualTaskGates.ManualTaskGate<T>                                                          98.5%
  PatternKit.Application.ManualTaskGates.ManualTaskGateState<T>                                                      100%
  PatternKit.Application.ManualTaskGates.ManualTaskRecord<T>                                                        96.9%

@JerrettDavis JerrettDavis merged commit 6c0f5cf into main May 31, 2026
12 checks passed
@JerrettDavis JerrettDavis deleted the coverage/harden-proxy-generator-413 branch May 31, 2026 17:42
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.

2 participants