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
1 change: 1 addition & 0 deletions eng/developer-docs/dotnet-release-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Add due dates to each of the issues so that we don't lose track of them.
- [ ] Update samples to new .NET version
- Consider creating new samples to feature new .NET or .NET Docker features
- [ ] Update documentation as necessary to reference the new .NET version
- [ ] Update `dotnetVersionChannel` in `eng/pipelines/cg-code.yml` to the new .NET version
- [ ] Update IIS sample URL to preview version of `dotnet-hosting-win.exe` (`/dotnet/<version>/preview/`): <https://github.com/dotnet/dotnet-docker/blob/main/samples/AspNetCoreRazorApp/Dockerfile.windowsservercore-iis#L19>.
- [ ] Review supported OS versions for new .NET version before release
- Include only the latest/LTS version of each operating system according to our [supported operating systems documentation](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-platforms.md#operating-systems).
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/cg-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ extends:
parameters:
# This should match the latest .NET version used across all projects in the repo, including samples.
# Otherwise, the pipeline will fail to build projects.
dotnetVersionChannel: '10.0'
dotnetVersionChannel: '11.0'
cgDryRun: ${{ parameters.cgDryRun }}
6 changes: 6 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/ProductImageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ private bool SupportsGlobalization

public string GetDockerfilePath(DotNetImageRepo imageRepo)
{
// Aspire Dashboard Dockerfiles are not organized by product version or OS.
if (imageRepo == DotNetImageRepo.Aspire_Dashboard)
{
return $"{GetRepoSrcPath(imageRepo)}/{GetArchLabel()}";
}

IEnumerable<string> pathComponents =
[
GetRepoSrcPath(imageRepo),
Expand Down
39 changes: 39 additions & 0 deletions tests/Microsoft.DotNet.Docker.Tests/TestDataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,45 @@ public void VerifyTestData(DotNetImageRepo imageRepo)
manifestTagsByPlatform.ShouldSatisfyAllConditions(conditions);
}

// Verifies that test data maps to Dockerfile paths in the manifest. Otherwise, path-filtered test runs
// silently skip the test data. SDK and runtime-deps are excluded because their test data intentionally
// includes entries without a corresponding Dockerfile (e.g. distroless SDKs, Windows runtime-deps).
[Theory]
[InlineData(DotNetImageRepo.Runtime)]
[InlineData(DotNetImageRepo.Aspnet)]
[InlineData(DotNetImageRepo.Monitor)]
[InlineData(DotNetImageRepo.Monitor_Base)]
[InlineData(DotNetImageRepo.Aspire_Dashboard)]
[InlineData(DotNetImageRepo.Yarp)]
public void VerifyTestDataDockerfilePaths(DotNetImageRepo imageRepo)
{
string repoName = ImageData.GetRepoName(ProductImageData.GetRepoName(imageRepo));
Repo? manifestRepo = _manifest.Repos.FirstOrDefault(r => r.Name == repoName);

// If the repo is not defined in the manifest, there are no images to test, so it's safe to return early.
// This can happen when an image repo is only published from the main branch or only from the nightly branch.
if (manifestRepo is null)
{
return;
}

HashSet<string> manifestDockerfilePaths = manifestRepo.Images
.SelectMany(image => image.Platforms)
.Select(platform => platform.Dockerfile)
.ToHashSet(StringComparer.OrdinalIgnoreCase);

Action[] conditions = GetTestData(imageRepo)
.Select(productImageData => productImageData.GetDockerfilePath(imageRepo))
.Distinct()
.Select<string, Action>(dockerfilePath => () =>
manifestDockerfilePaths.ShouldContain(
dockerfilePath,
$"Expected test data Dockerfile path '{dockerfilePath}' to exist in the manifest."))
.ToArray();

manifestDockerfilePaths.ShouldSatisfyAllConditions(conditions);
}

private static IEnumerable<ProductImageData> GetTestData(DotNetImageRepo repo) =>
TestData.AllImageData.Where(p => p.SupportedImageRepos.HasFlag(repo));
}
Loading