-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to disable configuration of EnvironmentAndSystemPropertyClientProviderStrategy
through Testcontainers
#4387
Conversation
Once the new docker-java version is released, we can change the ENV check to the new getter from docker-java/docker-java#1692. |
Shouldn't we add some unit tests for this? Our configuration/environment detection is pretty complex and regressions are especially painful to detect. |
I was only thinking about |
@rnorth I added unit tests, that captures the behavior. But TBH, I am not sure if this will save us from regressions since they are extremely whitebox and IMO the regressions are most likely to be introduced through a combination of Another indicator for this test is too tightly connected to the implementation come from the fact, that we have to change the test (i.e. the mocking) once we switch to using the new getter in docker-java. |
core/src/test/java/org/testcontainers/utility/TestcontainersConfigurationTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@kiview the code looks good. There are some CI failures tho - PTAL |
With ❤️ from the Gradle Plugins server 🙄 |
#4118 added the ability to configure
EnvironmentAndSystemPropertyClientProviderStrategy
through the Testcontainers configuration mechanism. However, in some advanced use cases, it can be desirable to keep the legacy behavior for configuring Docker host detection only.This PR allows switching this behavior by configuring
dockerconfig.source
as eithertestcontainers
(current behavior) ordocker
(legacy behavior).In addition,
EnvironmentAndSystemPropertyClientProviderStrategy
is not considered a persistable strategy anymore. In most cases, this should effectively make no difference since it is the strategy with the highest priority of the strategies that are included in Testcontainers.This high priority strategy property is also the reason, why this PR removes the code introduced by #4175, since it still will be selected by the discovery mechanism.