Repository navigation
Description
After the following changes, there is lots of test code that can be cleaned up/reorganized.
- .NET 10 SDK AOT container images #6312
- Remove .NET 8 and 9 AOT runtime-deps images #6352
- Remove .NET 8 and 9 AOT SDK images #6358
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.
dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/TestData.cs
Lines 229 to 232 in bffebfd
| 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:
dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs
Lines 61 to 75 in bffebfd
| [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):
dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs
Lines 34 to 35 in bffebfd
| public DotNetImageVariant SdkImageVariant { get; init; } = DotNetImageVariant.None; | |
This workaround can be removed:
dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/TestDataTests.cs
Lines 53 to 66 in bffebfd
| // 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:
dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs
Lines 49 to 54 in bffebfd
| if (imageData.ImageVariant.HasFlag(DotNetImageVariant.AOT)) | |
| { | |
| OutputHelper.WriteLine( | |
| $"Test is not applicable to AOT images. See {nameof(VerifyAotWebScenario)} instead."); | |
| return; | |
| } |
dotnet-docker/tests/Microsoft.DotNet.Docker.Tests/RuntimeDepsImageTests.cs
Lines 26 to 27 in bffebfd
| public static IEnumerable<object[]> GetAotImageData() => | |
| GetImageData(DotNetImageRepo.Runtime_Deps, DotNetImageVariant.AOT); |
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsCurrent Release
Activity