gradle-docker-plugin
gradle-docker-plugin copied to clipboard
Development documentation about customizing functional tests is wrong
The manual says in the development section, that you can use various system properties and / or Gradle properties and / or environment variables to customize the functional test environment.
But this does not work.
The build does not look at those gradle properties and also does not forward the system properties and environment variables to the test task which is executed in a forked worker process.
So currently there is no way to change these properties besides editing the TestConfiguration
class.
AFAIKT the system properties are passed down to the build script used by the functional test which then assign the value via the plugin's DSL. For example, see https://github.com/bmuschko/gradle-docker-plugin/blob/master/src/functTest/groovy/com/bmuschko/gradle/docker/AbstractGroovyDslFunctionalTest.groovy#L46-L64.
The code you linked forwards from the test to the executed build. But nothing forwards from the main Gradle process down to the test task. Just try to use the documented ways to change those values and you will see that it does not work. I had to edit the values in exactly that file to change them instead of using a system property, Gradle propert or environment variable.