Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.

chore: make aweXpect.Reflection trimmable and Native AOT compatible - #385

Merged
vbreuss merged 1 commit into
mainfrom
chore/aot-compatible
Oct 10, 2026
Merged

vbreuss merged 1 commit into
mainfrom
chore/aot-compatible

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 10, 2026

Copy link
Copy Markdown
Member

After trimming, the members, interfaces, types and referenced assemblies of a subject can be removed, so the expectations would silently check less than they claim. The reflection is now guarded by ReflectionFallback.IsSupported and fails with a message naming the switch, like the built-in expectations, while nothing changes under the JIT. An AOT smoke-test project verifies this in CI, and aweXpect.Core is updated to 3.0.0, which provides the feature guard.

After trimming, the members, interfaces, types and referenced assemblies of a subject can be removed, so the expectations would silently check less than they claim. The reflection is now guarded by `ReflectionFallback.IsSupported` and fails with a message naming the switch, like the built-in expectations, while nothing changes under the JIT. An AOT smoke-test project verifies this in CI, and aweXpect.Core is updated to 3.0.0, which provides the feature guard.
@vbreuss vbreuss self-assigned this Oct 10, 2026
Copilot AI balanced review requested due to automatic review settings October 10, 2026 06:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vbreuss
vbreuss enabled auto-merge (squash) October 10, 2026 06:30
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 New issues

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@github-actions

Copy link
Copy Markdown

Test Results

    13 files  ±0      13 suites  ±0   11m 12s ⏱️ -12s
 6 922 tests ±0   6 919 ✅ ±0   3 💤 ±0  0 ❌ ±0 
41 377 runs  ±0  41 364 ✅ ±0  13 💤 ±0  0 ❌ ±0 

Results for commit b76ee50. ± Comparison against base commit a0469ab.

@vbreuss
vbreuss merged commit 197d383 into main Oct 10, 2026
15 of 16 checks passed
@vbreuss
vbreuss deleted the chore/aot-compatible branch October 10, 2026 07:02
@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.64GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.303
[Host] : .NET 10.0.12 (10.0.12, 10.0.1226.42308), X64 RyuJIT x86-64-v3
DefaultJob : .NET 10.0.12 (10.0.12, 10.0.1226.42308), X64 RyuJIT x86-64-v3

Method Mean Error StdDev Gen0 Allocated
TypeIsNotStatic_aweXpect 134.3 ns 1.00 ns 0.93 ns 0.0248 416 B

@github-actions

Copy link
Copy Markdown

👽 Mutation Results

Mutation testing badge

aweXpect.Reflection

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Runtime Errors Total Detected Total Undetected Total Mutants
Collections/Filtered.Types.cs 87.23% 41 1 0 5 24 8 0 41 6 79
Filters/AssemblyFilters.WhichDependOn.cs 100.00% 1 0 0 0 1 0 0 1 0 2
Filters/AssemblyFilters.WhichDoNotDependOn.cs 100.00% 2 0 0 0 1 0 0 2 0 3
Helpers/AssemblyHelpers.cs 91.80% 56 3 0 2 12 5 0 56 5 78
Helpers/MethodInfoHelpers.cs 80.34% 94 14 0 9 38 4 0 94 23 159
Helpers/NullabilityHelpers.cs 71.60% 58 7 0 16 31 34 0 58 23 146
Helpers/ReflectionFallbackHelpers.cs 0.00% 0 0 0 3 0 0 0 0 3 3
Helpers/TypeHelpers.cs 76.95% 474 81 0 61 201 64 0 474 142 881
ThatAssemblies.DependOn.cs 70.00% 7 0 0 3 0 8 0 7 3 18
ThatAssemblies.DoNotDependOn.cs 66.67% 8 0 0 4 0 8 0 8 4 20
ThatAssembly.DependsOn.cs 93.33% 14 1 0 0 3 8 0 14 1 26

The final mutation score is 78.24%

Coverage Thresholds: high:80 low:60 break:0

@github-actions github-actions Bot added the state: released The issue is released label Oct 10, 2026
@github-actions

Copy link
Copy Markdown

This is addressed in release v3.0.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

state: released The issue is released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants