Closed thaJeztah closed 1 day ago
Name | Link |
---|---|
Latest commit | b4af24f9d63968ef3be6779675c42c8f78da4d51 |
Latest deploy log | https://app.netlify.com/sites/testcontainers-go/deploys/6683d3b662908c00088025b2 |
Deploy Preview | https://deploy-preview-2614--testcontainers-go.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
What does this PR do?
remove TestProviderHasConfig as it wasn't testing anything
This test was verifying that DockerProvider.Config() returned a non-nil value, but Config() does not return a pointer, so it would always pass (even with an empty struct).
TestContainerLogWithErrClosed: rename variable that shadowed import
NewDockerProvider: inline intermediate variables
modules/compose: NewDockerComposeWith: don't use deprecated RyukDisabled
The TestcontainersConfig.RyukDisabled field is deprecated. NewDockerProvider() uses ReadConfig() internally to load the config, which always copies its value from config.Config.RyukDisabled field, which is not deprecated.
This patch removes the extra redirection, and changes the code to use Config.RyukDisabled instead.
DockerProvider: don't use legacy TestcontainersConfig internally
All fields in TestcontainersConfig are deprecated, making it a wrapper around config.Config and DockerProvider internally only depends on config.Config. All deprecated fields contain a copy of values available in config.Config.
However, the exported
Config()
has TestcontainersConfig as return type; filling the deprecated fields is is currently handled by ReadConfig, but straightforward, so we can inline that code in theConfig()
method.This patch:
Config()
method; theConfig()
method did not provide value for internal use; theconfig
field is not mutated (so no synchronisation needed for concurrency).Config()
method to handle conversion of the config.Config to aTestcontainersConfig
(effectively inlining a copy ofReadConfig
)After this patch, the only remaining use of
ReadConfig
in testcontainers-go itself is in tests (TestReadConfig
); as a follow-up, we can consider deprecatingReadConfig
andTestcontainersConfig
, althoughDockerProvider
may need a newConfig()
method with a different signature if its config must be accessible for others, which would require theContainerProvider
andReaperProvider
interfaces to be updated.Why is it important?
Remove uses of deprecated fields to make it easier to spot where it's still used.
Follow-ups
consider deprecating
ReadConfig
andTestcontainersConfig
, althoughDockerProvider
may need a newConfig()
method with a different signature if its config must be accessible for others, which would require theContainerProvider
andReaperProvider
interfaces to be updated.