Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private bool TargetRuntimeIdentiriersAreValid()
{
if (muslRidsCount == TargetRuntimeIdentifiers.Length)
{
IsMuslRid = true;
IsMuslRid = true;
}
else
{
Expand Down Expand Up @@ -191,7 +191,7 @@ private bool ComputeRepositoryAndTag([NotNullWhen(true)] out string? repository,
&& !UsesInvariantGlobalization
&& versionAllowsUsingAOTAndExtrasImages
// the extras only became available on the stable tags of the FirstVersionWithNewTaggingScheme
&& (!parsedVersion.IsPrerelease && parsedVersion.Major == FirstVersionWithNewTaggingScheme))
&& (!parsedVersion.IsPrerelease && parsedVersion.Major >= FirstVersionWithNewTaggingScheme))
{
Log.LogMessage("Using extra variant because the application needs globalization");
tag += "-extra";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void CanDeferContainerAppCommand(
}, projectName: $"{nameof(CanDeferContainerAppCommand)}_{prop}_{value}_{string.Join("_", expectedAppCommandArgs)}");
using var _ = d;
var instance = project.CreateProjectInstance(ProjectInstanceSettings.None);
instance.Build([ ComputeContainerConfig ], []);
instance.Build([ComputeContainerConfig], []);
var computedAppCommand = instance.GetItems(ContainerAppCommand).Select(i => i.EvaluatedInclude);

// The test was not testing anything previously, as the list returned was zero length,
Expand Down Expand Up @@ -614,6 +614,51 @@ public void AOTAppsLessThan8WithCulturesDoNotGetExtraImages(string rid, string e
computedBaseImageTag.Should().BeEquivalentTo(expectedImage);
}

[InlineData("8.0.100", "v8.0", "jammy-chiseled", "mcr.microsoft.com/dotnet/runtime:8.0-jammy-chiseled-extra")]
[InlineData("9.0.100", "v9.0", "noble-chiseled", "mcr.microsoft.com/dotnet/runtime:9.0-noble-chiseled-extra")]
[InlineData("10.0.100", "v10.0", "noble-chiseled", "mcr.microsoft.com/dotnet/runtime:10.0-noble-chiseled-extra")]
Comment on lines +618 to +619
Copy link
Member

Choose a reason for hiding this comment

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

Might as well cover the 8.0 case here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added .NET 8.0 test case in commit 2397fde.

[Theory]
public void FDDConsoleAppWithCulturesAndOptingIntoChiseledGetsExtrasForNet9AndLater(string sdkVersion, string tfm, string containerFamily, string expectedImage)
{
var (project, logger, d) = ProjectInitializer.InitProject(new()
{
["NetCoreSdkVersion"] = sdkVersion,
["TargetFrameworkVersion"] = tfm,
[KnownStrings.Properties.ContainerRuntimeIdentifier] = "linux-x64",
[KnownStrings.Properties.ContainerFamily] = containerFamily,
[KnownStrings.Properties.InvariantGlobalization] = false.ToString(),
}, projectName: $"{nameof(FDDConsoleAppWithCulturesAndOptingIntoChiseledGetsExtrasForNet9AndLater)}_{sdkVersion}_{tfm}_{containerFamily}");
using var _ = d;
var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None);
instance.Build(new[] { ComputeContainerBaseImage }, null, null, out var outputs).Should().BeTrue(String.Join(Environment.NewLine, logger.Errors));
var computedBaseImageTag = instance.GetProperty(ContainerBaseImage)?.EvaluatedValue;
computedBaseImageTag.Should().BeEquivalentTo(expectedImage);
}

[InlineData("8.0.100", "v8.0", "jammy-chiseled", "mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled-extra")]
[InlineData("9.0.100", "v9.0", "noble-chiseled", "mcr.microsoft.com/dotnet/aspnet:9.0-noble-chiseled-extra")]
[InlineData("10.0.100", "v10.0", "noble-chiseled", "mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-extra")]
Comment on lines +639 to +640
Copy link
Member

Choose a reason for hiding this comment

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

Might as well cover the 8.0 case here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added .NET 8.0 test case in commit 2397fde.

[Theory]
public void FDDAspNetAppWithCulturesAndOptingIntoChiseledGetsExtrasForNet9AndLater(string sdkVersion, string tfm, string containerFamily, string expectedImage)
{
var (project, logger, d) = ProjectInitializer.InitProject(new()
{
["NetCoreSdkVersion"] = sdkVersion,
["TargetFrameworkVersion"] = tfm,
[KnownStrings.Properties.ContainerRuntimeIdentifier] = "linux-x64",
[KnownStrings.Properties.ContainerFamily] = containerFamily,
[KnownStrings.Properties.InvariantGlobalization] = false.ToString(),
}, bonusItems: new()
{
[KnownStrings.Items.FrameworkReference] = KnownFrameworkReferences.WebApp
}, projectName: $"{nameof(FDDAspNetAppWithCulturesAndOptingIntoChiseledGetsExtrasForNet9AndLater)}_{sdkVersion}_{tfm}_{containerFamily}");
using var _ = d;
var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None);
instance.Build(new[] { ComputeContainerBaseImage }, null, null, out var outputs).Should().BeTrue(String.Join(Environment.NewLine, logger.Errors));
var computedBaseImageTag = instance.GetProperty(ContainerBaseImage)?.EvaluatedValue;
computedBaseImageTag.Should().BeEquivalentTo(expectedImage);
}

[Fact]
public void AspNetFDDAppsGetAspNetBaseImage()
{
Expand Down