Skip to content

Commit

Permalink
Only print Mongo container ID if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
rmunn committed Aug 26, 2024
1 parent 4bfb265 commit b1c483e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/LfMerge.Core.Tests/SRTestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,11 @@ protected override void Dispose(bool disposing)
if (CleanUpTestData) {
StopMongo();
} else {
Console.WriteLine($"Leaving Mongo container {MongoContainerId} around to examine data on failed test.");
Console.WriteLine($"It is listening on {Settings.MongoDbHostNameAndPort}");
Console.WriteLine($"To delete it, run `docker stop {MongoContainerId} ; docker rm {MongoContainerId}`.");
if (MongoContainerId is not null) {
Console.WriteLine($"Leaving Mongo container {MongoContainerId} around to examine data on failed test.");
Console.WriteLine($"It is listening on {Settings.MongoDbHostNameAndPort}");
Console.WriteLine($"To delete it, run `docker stop {MongoContainerId} ; docker rm {MongoContainerId}`.");
}
}
}
base.Dispose(disposing);
Expand Down

0 comments on commit b1c483e

Please sign in to comment.