-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix -extra container variant check to support .NET 9+ #52161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
aee00c5
Initial plan
Copilot 8c06e5a
Fix comparison to use >= for -extra variant support and add tests for…
Copilot 07dda7b
Apply code formatting with dotnet format
Copilot 77c1e62
Fix semicolon placement to match repo style
Copilot 2397fde
Add .NET 8.0 test coverage to extra variant tests
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
|
@@ -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")] | ||
| [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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might as well cover the 8.0 case here as well.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() | ||
| { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.