Skip to content
Permalink
Browse files
Enable passing of system properties to tests via special namespace
If a system property prefixed with jmeter.properties. is found, Gradle will
now pass it as a system property without that prefix to the unit tests.
That allows to set system properties (which might be used as jmeter properties)
to the unit tests, without setting them in the JVM, that is used by Gradle.
  • Loading branch information
FSchumacher committed Mar 5, 2022
1 parent 73b30cb commit 2c14e913adfeecaf3cc4fbfab38dc44c4d2b2d84
Showing 2 changed files with 6 additions and 2 deletions.
@@ -60,7 +60,7 @@ matrix:
script:
# This job verifies headless mode to ensure Apache JMeter is workable in headless as well
# Spotless and Checkstyle are skipped here to save some time. They are verified anyway in Java 8 and Java 13 builds, so skipping them for Java 11 does not harm
- ./gradlew build -Djava.awt.headless=true -Djmeter.use_java_regex=true -Duser.language=fr -Duser.country=FR -PskipCheckstyle -PskipSpotless $SKIP_TAR
- ./gradlew build -Djava.awt.headless=true -Djmeter.properties.jmeter.use_java_regex=true -Duser.language=fr -Duser.country=FR -PskipCheckstyle -PskipSpotless $SKIP_TAR
- name: Tests with OpenJDK 11 on s390x
os: linux
arch: s390x
@@ -600,7 +600,11 @@ allprojects {
val value = System.getProperty(name) ?: default
value?.let { systemProperty(name, it) }
}
passProperty("jmeter.use_java_regex")
System.getProperties().filter {
it.key.toString().startsWith("jmeter.properties.")
}.forEach {
systemProperty(it.key.toString().substring("jmeter.properties.".length), it.value)
}
passProperty("java.awt.headless")
passProperty("skip.test_TestDNSCacheManager.testWithCustomResolverAnd1Server")
passProperty("junit.jupiter.execution.parallel.enabled", "true")

0 comments on commit 2c14e91

Please sign in to comment.