Skip to content

Commit bb41cdc

Browse files
authored
chore: update linux smoke tests to only remove networks in debug build (#2088)
* chore: update linux smoke tests to only remove networks in debug build * experiment: Create a kafka broker container for each kafka test app * Revert previous docker-compose change; add logging on container cleanup
1 parent 09ab29d commit bb41cdc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/Agent/IntegrationTests/ContainerIntegrationTests/ContainerFixtures/ContainerApplication.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public override void Shutdown()
189189
private void CleanupContainer()
190190
{
191191
Console.WriteLine($"[{AppName} {DateTime.Now}] Cleaning up container and images related to {ContainerName} container.");
192+
TestLogger?.WriteLine($"[{AppName}] Cleaning up container and images related to {ContainerName} container.");
192193
// ensure there's no stray containers or images laying around
193194
Process.Start("docker", $"container rm --force {ContainerName}");
194195
Process.Start("docker", $"image rm --force {ContainerName}");
@@ -197,12 +198,16 @@ private void CleanupContainer()
197198
{
198199
foreach (var dep in DockerDependencies)
199200
{
201+
Console.WriteLine($"[{AppName} {DateTime.Now}] Removing dependent container: {dep}.");
202+
TestLogger?.WriteLine($"[{AppName}] Removing dependent container: {dep}.");
200203
Process.Start("docker", $"container rm --force {dep}");
201204
}
202205
}
203206

207+
#if DEBUG
204208
// Cleanup the networks with no attached containers. Mainly for testings on dev laptops - they can build up and block runs.
205209
Process.Start("docker", "network prune -f");
210+
#endif
206211
}
207212

208213
protected virtual void WaitForAppServerToStartListening(Process process, bool captureStandardOutput)

0 commit comments

Comments
 (0)