Skip to content

Commit

Permalink
Run globalization tests on aspnet images
Browse files Browse the repository at this point in the history
  • Loading branch information
lbussell committed Nov 6, 2024
1 parent 5a34536 commit 3b01e6e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
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

0 comments on commit 3b01e6e

Please sign in to comment.