Skip to content
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

Run globalization tests on aspnet images #6030

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/AspnetImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public async Task VerifyFxDependentAppScenario(ProductImageData imageData)
await scenario.ExecuteAsync();
}

[DotNetTheory]
[MemberData(nameof(GetImageData))]
public async Task VerifyGlobalizationScenario(ProductImageData imageData) =>
await VerifyGlobalizationScenarioBase(imageData);

[DotNetTheory]
[MemberData(nameof(GetImageData))]
public void VerifyEnvironmentVariables(ProductImageData imageData)
Expand Down
17 changes: 17 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/CommonRuntimeImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Microsoft.DotNet.Docker.Tests.TestScenarios;

namespace Microsoft.DotNet.Docker.Tests
{
Expand Down Expand Up @@ -79,5 +81,20 @@ protected void VerifyCommonShellNotInstalledForDistroless(ProductImageData image

Assert.Contains("Exit code: 127", ex.Message);
}

protected async Task VerifyGlobalizationScenarioBase(ProductImageData imageData)
{
// Inclusion of tzdata and icu together was not consistent in .NET 6, so skip the test.
// Remove once .NET 6 is EOL.
if (imageData.Version.Major == 6)
{
return;
}

using (GlobalizationScenario testScenario = new(imageData, ImageRepo, DockerHelper))
{
await testScenario.ExecuteAsync();
}
}
}
}
16 changes: 2 additions & 14 deletions tests/Microsoft.DotNet.Docker.Tests/RuntimeImageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,8 @@ public async Task VerifyTestProjectScenario(ProductImageData imageData)

[DotNetTheory]
[MemberData(nameof(GetImageData))]
public async Task VerifyGlobalizationScenario(ProductImageData imageData)
{
// Inclusion of tzdata and icu together was not consistent in .NET 6, so skip the test.
// Remove once .NET 6 is EOL.
if (imageData.Version.Major == 6)
{
return;
}

using (GlobalizationScenario testScenario = new(imageData, ImageRepo, DockerHelper))
{
await testScenario.ExecuteAsync();
}
}
public async Task VerifyGlobalizationScenario(ProductImageData imageData) =>
await VerifyGlobalizationScenarioBase(imageData);

[DotNetTheory]
[MemberData(nameof(GetImageData))]
Expand Down