Skip to content

test: run the public entry points as a Native AOT test executable - #67

Merged
Blind-Striker merged 3 commits into
aot/issue-63-tryadd-use-service-urlfrom
aot/native-aot-test-lane
Oct 23, 2026
Merged

Blind-Striker merged 3 commits into
aot/issue-63-tryadd-use-service-urlfrom
aot/native-aot-test-lane

Conversation

@Blind-Striker

@Blind-Striker Blind-Striker commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Stack (review bottom-up, merge as one stack): #62 base, #66 the #63 fix, #67 Native AOT test lane, #68 static-factory generic path, #70 slim generator, #71 public docs, #72 internal docs and 3.0.0, #73 reflection-free test, #74 package consumer in CI, #75 convention clean-up, #76 service catalog refresh.

Goal of the stack: 3.0.0, where existing consumers upgrade without code changes, both packages support Native AOT on net10.0/net11.0, and the libraries use no runtime reflection for types the compiler can see (a JIT-only fallback covers the rest).

This PR

Adds tests/LocalStack.Client.NativeAot.Tests (xUnit v3 4.0.2 AOT, net10.0/net11.0). It is published with PublishAot and run as a native executable by the new native-aot-tests CI job (windows-latest, ubuntu-22.04); TreatWarningsAsErrors makes any trim/AOT warning fail the publish. It covers the unchanged AddLocalStack + AddAwsService<IAmazonS3> consumer, all 8 registration overloads, Core Session generic and Type paths, and SessionStandalone. Linux also runs live S3/SQS round trips against LocalStack 4.14.0. Cake skips projects that set LocalStackTestRunsAsPublishedExecutable, because they are not dotnet test targets. Frameworks come from LocalStackModernTargetFrameworks; CI reads them through msbuild -getProperty. Test names follow the Should convention.

Verification

Local win-x64: net10.0 and net11.0 publish with 0 IL warnings; 35/35 pass with LocalStack running, 33 pass and 2 skip without it. The CI job is green on Windows and Linux.

@Blind-Striker
Blind-Striker added this pull request to stack #69 October 23, 2026 11:12
@github-actions

Copy link
Copy Markdown

Dependency Review

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

OpenSSF Scorecard

PackageVersionScoreDetails
nuget/AWSSDK.DynamoDBv2 >= 0 UnknownUnknown
nuget/AWSSDK.S3 >= 0 UnknownUnknown
nuget/AWSSDK.SQS >= 0 UnknownUnknown
nuget/AWSSDK.SimpleNotificationService >= 0 UnknownUnknown
nuget/Microsoft.Extensions.Configuration >= 0 UnknownUnknown
nuget/Microsoft.Extensions.Configuration.EnvironmentVariables >= 0 UnknownUnknown
nuget/Microsoft.Extensions.Configuration.Json >= 0 UnknownUnknown
nuget/Microsoft.Extensions.DependencyInjection >= 0 UnknownUnknown
nuget/xunit.v3.aot.mtp-v2 >= 0 UnknownUnknown

Scanned Files

  • tests/LocalStack.Client.NativeAot.Tests/LocalStack.Client.NativeAot.Tests.csproj

Add LocalStack.Client.NativeAot.Tests (xUnit v3 4.0.2 AOT, net10.0/net11.0).
It is published with PublishAot and run as a native executable, so trim/AOT
warnings fail the publish (TreatWarningsAsErrors) and the tests prove the
existing calls work with no consumer code change:

- AddLocalStack + AddAwsService<IAmazonS3> + resolve, as consumers write it
- every AddAwsService/AddAWSServiceLocalStack/TryAdd* overload
- Session generic and Type-based interface/implementation paths, and
  SessionStandalone, for S3 and SQS
- live S3 and SQS round trips when LOCALSTACK_NATIVE_AOT_HOST is set

CI gets a native-aot-tests job (windows-latest, ubuntu-22.04); Linux starts
LocalStack 4.14.0 for the live tests. The Cake test task skips the project
because it is not a dotnet test target.
- The lane's target frameworks come from LocalStackModernTargetFrameworks,
  and CI publishes and runs every framework MSBuild reports instead of
  listing net10.0 and net11.0 by hand.
- Cake skips test projects that set LocalStackTestRunsAsPublishedExecutable
  (read through MSBuild with the target frameworks) instead of matching a
  project name.
@Blind-Striker
Blind-Striker force-pushed the aot/native-aot-test-lane branch from 97a0d28 to a1af327 Compare October 23, 2026 20:24
@Blind-Striker
Blind-Striker marked this pull request as ready for review October 23, 2026 21:54
@Blind-Striker
Blind-Striker merged commit 49573c2 into master Oct 23, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant