Skip to content

Clean up test code after new .NET 10 AOT image approach #6359

Open

Description

@lbussell

After the following changes, there is lots of test code that can be cleaned up/reorganized.

Here's a quick summary of what I could see.

AOT test data is based on runtime-deps images. It should be based on the SDK images instead now.

new() { Version = V10_0_Preview, Arch = Arch.Amd64, SdkImageVariant = DotNetImageVariant.AOT, SupportedImageRepos = DotNetImageRepo.Runtime_Deps, OS = OS.Alpine321 },
new() { Version = V10_0_Preview, Arch = Arch.Amd64, SdkImageVariant = DotNetImageVariant.AOT, SupportedImageRepos = DotNetImageRepo.Runtime_Deps, OS = OS.AzureLinux30Distroless, SdkOS = OS.AzureLinux30 },
new() { Version = V10_0_Preview, Arch = Arch.Amd64, SdkImageVariant = DotNetImageVariant.AOT, SupportedImageRepos = DotNetImageRepo.Runtime_Deps, OS = OS.NobleChiseled, SdkOS = OS.Noble },
new() { Version = V10_0_Preview, Arch = Arch.Amd64, SdkImageVariant = DotNetImageVariant.AOT, SupportedImageRepos = DotNetImageRepo.Runtime_Deps, OS = OS.TrixieSlim },

The AOT test scenarios should be moved to the SDK tests class:

[LinuxImageTheory]
[MemberData(nameof(GetAotImageData))]
public async Task VerifyAotWebScenario(ProductImageData imageData)
{
if (imageData.Arch == Arch.Arm)
{
OutputHelper.WriteLine("Skipping test due to https://github.com/dotnet/docker-tools/issues/1177. "
+ "ImageBuilder is unable to queue arm32 AOT images together with the arm64 AOT SDKs. "
+ "Re-enable once fixed.");
return;
}
using WebScenario scenario = new WebScenario.Aot(imageData, DockerHelper, OutputHelper);
await scenario.ExecuteAsync();
}

ProductImageData.SdkImageVariant is no longer necessary (its purpose can be covered by just the regular ImageVariant property):

public DotNetImageVariant SdkImageVariant { get; init; } = DotNetImageVariant.None;

This workaround can be removed:

// Account for SDK AOT images. They are tested based on the runtime-deps images.
if (imageRepo == DotNetImageRepo.SDK)
{
testDataTags =
[
..testDataTags,
..GetTestData(DotNetImageRepo.Runtime_Deps)
.Where(productImageData => productImageData.SdkImageVariant.HasFlag(DotNetImageVariant.AOT))
.Select(productImageData =>
productImageData
.GetImage(imageRepo, _dockerHelper, skipPull: true)
.Split(':')[1])
];
}

All runtime deps AOT special cases can be removed:

if (imageData.ImageVariant.HasFlag(DotNetImageVariant.AOT))
{
OutputHelper.WriteLine(
$"Test is not applicable to AOT images. See {nameof(VerifyAotWebScenario)} instead.");
return;
}

public static IEnumerable<object[]> GetAotImageData() =>
GetImageData(DotNetImageRepo.Runtime_Deps, DotNetImageVariant.AOT);

Activity

  1. moved this from Backlog to Current Release in .NET Dockeron Apr 7, 2025
  2. added theissue type on Apr 7, 2025
  3. moved this from Current Release to Post Release in .NET Dockeron Aug 11, 2025
  4. moved this from Post Release to Current Release in .NET Dockeron Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    • Status
      Current Release

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions