From 67e3756fc22f1323ed436026e104036099b0e52b Mon Sep 17 00:00:00 2001 From: KaliCZ Date: Thu, 28 May 2026 23:43:54 +0200 Subject: [PATCH] Group integration-test containers under StrongTypes in Docker Desktop Stamp the SQL Server and PostgreSQL Testcontainers with the com.docker.compose.project=StrongTypes label so Docker Desktop nests them under a single collapsible StrongTypes group instead of listing them as loose, random-named containers. The Ryuk resource reaper container is intentionally left ungrouped: Testcontainers 4.0.0 builds it internally with no label hook, and it is shared infrastructure rather than part of this project. Co-Authored-By: Claude Opus 4.8 --- .../Infrastructure/TestWebApplicationFactory.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/StrongTypes.Api.IntegrationTests/Infrastructure/TestWebApplicationFactory.cs b/src/StrongTypes.Api.IntegrationTests/Infrastructure/TestWebApplicationFactory.cs index 868f032e..e2f70a9f 100644 --- a/src/StrongTypes.Api.IntegrationTests/Infrastructure/TestWebApplicationFactory.cs +++ b/src/StrongTypes.Api.IntegrationTests/Infrastructure/TestWebApplicationFactory.cs @@ -16,8 +16,16 @@ namespace StrongTypes.Api.IntegrationTests.Infrastructure; /// public sealed class TestWebApplicationFactory : WebApplicationFactory, IAsyncLifetime { - private readonly MsSqlContainer _sqlContainer = new MsSqlBuilder().Build(); - private readonly PostgreSqlContainer _pgContainer = new PostgreSqlBuilder().Build(); + private const string DockerGroupLabel = "com.docker.compose.project"; + private const string DockerGroupName = "StrongTypes"; + + private readonly MsSqlContainer _sqlContainer = new MsSqlBuilder() + .WithLabel(DockerGroupLabel, DockerGroupName) + .Build(); + + private readonly PostgreSqlContainer _pgContainer = new PostgreSqlBuilder() + .WithLabel(DockerGroupLabel, DockerGroupName) + .Build(); async ValueTask IAsyncLifetime.InitializeAsync() {