Skip to content

test(generators): cover translator and queue policies#445

Merged
JerrettDavis merged 1 commit into
mainfrom
test/translator-queue-coverage-413
May 30, 2026
Merged

test(generators): cover translator and queue policies#445
JerrettDavis merged 1 commit into
mainfrom
test/translator-queue-coverage-413

Conversation

@JerrettDavis

Copy link
Copy Markdown
Owner

Summary

  • Preserve nested containing types and skip Roslyn error type arguments in Message Translator, Priority Queue, and Queue Load Leveling generators.
  • Convert Message Translator generator tests to TinyBDD xUnit scenarios.
  • Add TinyBDD coverage for nested hosts, malformed type arguments, escaped names, defaults, and invalid configuration/signature paths.

Validation

  • Focused generator tests passed across net8/net9/net10 for QueueLoadLevelingPolicyGeneratorTests, PriorityQueueGeneratorTests, and MessageTranslatorGeneratorTests.
  • Full PatternKit.Generators.Tests coverage pass passed across net8/net9/net10: 1480 tests per TFM.
  • dotnet format PatternKit.slnx --verify-no-changes --verbosity minimal.

Generator coverage after slice: PatternKit.Generators 97.1%; MessageTranslatorGenerator 97.2%; PriorityQueueGenerator 96.5%; QueueLoadLevelingPolicyGenerator 96.1%.

Copilot AI review requested due to automatic review settings May 30, 2026 03:43
@github-actions

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 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.Error handling 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();
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Summary
  Generated on: 05/30/2026 - 03:51:15
  Coverage date: 05/30/2026 - 03:48:40 - 05/30/2026 - 03:51:04
  Parser: MultiReport (12x Cobertura)
  Assemblies: 5
  Classes: 1616
  Files: 551
  Line coverage: 96.6%
  Covered lines: 43464
  Uncovered lines: 1524
  Coverable lines: 44988
  Total lines: 96790
  Branch coverage: 82.2% (13595 of 16527)
  Covered branches: 13595
  Total branches: 16527
  Method coverage: 96.6% (8443 of 8734)
  Full method coverage: 90.2% (7882 of 8734)
  Covered methods: 8443
  Fully covered methods: 7882
  Total methods: 8734

PatternKit.Core                                                                                                     95.4%
  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.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.MaterializedViews.MaterializedView<T1, T2>                                                 98.4%
  PatternKit.Application.Repository.InMemoryRepository<T1, T2>                                                      92.8%
  PatternKit.Application.Repository.RepositoryResult<T>                                                             93.3%
  PatternKit.Application.ServiceLayer.ServiceLayerOperation<T1, T2>                                                 96.7%
  PatternKit.Application.ServiceLayer.ServiceLayerResult<T>                                                         94.7%
  PatternKit.Application.ServiceLayer.ServiceLayerRule<T>                                                            100%
  PatternKit.Application.Specification.Specification<T>                                                              100%

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    12 files      12 suites   11m 7s ⏱️
 3 823 tests  3 823 ✅ 0 💤 0 ❌
11 900 runs  11 900 ✅ 0 💤 0 ❌

Results for commit 5edae36.

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.77%. Comparing base (05621f5) to head (5edae36).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
unittests 96.77% <100.00%> (+5.28%) ⬆️

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

🔍 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 merged commit 1c7b002 into main May 30, 2026
13 checks passed
@JerrettDavis JerrettDavis deleted the test/translator-queue-coverage-413 branch May 30, 2026 03:56
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