testcontainers / testcontainers-dotnet

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
https://dotnet.testcontainers.org
MIT License
3.65k stars 250 forks source link

feat: Include the container name in the reuse hash #1162

Closed 0xced closed 2 months ago

0xced commented 2 months ago

What does this PR do?

This pull request removes the [JsonIgnore] attribute from the ContainerConfiguration.Name property so that the container name becomes part of the reuse hash.

Why is it important?

The rationale behind this change is explained in #1161.

[!IMPORTANT]
Changing the parts used in the reuse hash will break existing reused containers but the best time to do it is now, while the reuse feature is still at the experimental stage.

Related issues

Closes #1161

How to test this PR

A new unit test (ContainersWithDifferentNamesShouldHaveDifferentHashes) has been added.

netlify[bot] commented 2 months ago

Deploy Preview for testcontainers-dotnet ready!

Name Link
Latest commit d715a180a8e02a2b0cd056256c876f7947781f1e
Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/662b55eb7bf3d1000850f66e
Deploy Preview https://deploy-preview-1162--testcontainers-dotnet.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

0xced commented 2 months ago

Could you please update the documentation accordingly?

Of course! I just pushed d715a180a8e02a2b0cd056256c876f7947781f1e which updates the documentation.