Samuel Dobbie
07/26/2021, 5:10 PM# build.gradle.kts
tasks.withType<Test> {
...
environment = mapOf(
"VERSION" to "1.0",
"TYPE" to "some-type",
"NAME" to "some-name",
"PATH" to "some-path",
)
}
Whilst this works, I'm trying to remove this block and instead set these env variables in the bash script show below. The current approach of simply exporting the values doesn't seem to be making them available to the JVM.
# run-tests.sh
export VERSION=1.0
export TYPE=some-type
export NAME=some-name
export PATH=some-path
./gradlew test --tests HealthCheck
Any suggestions on how to resolve this would be much appreciated.Vampire
07/26/2021, 6:00 PMtasks.withType<Test> {
...
environment = mapOf(
"VERSION" to System.env["VERSION"],
"TYPE" to System.env["TYPE"],
"NAME" to System.env["NAME"],
"PATH" to System.env["PATH"]
)
}
No environment from outside is automatically forwarded to the tests or the tests would be flaky just by having a different environment which is bad and unwanted in 90% of the cases.Samuel Dobbie
07/26/2021, 6:14 PM