Skip to content

Commit 6c1abaf

Browse files
committed
Pass testOnlyPath in environment instead of command line.
It's typically a very very long string, which made Windows angry.
1 parent 2381c88 commit 6c1abaf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchTestBasePlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public void execute(Task t) {
182182
FileCollection mainRuntime = mainSourceSet.getRuntimeClasspath();
183183
FileCollection testRuntime = testSourceSet.getRuntimeClasspath();
184184
FileCollection testOnlyFiles = testRuntime.minus(mainRuntime);
185-
nonInputProperties.systemProperty("es.entitlement.testOnlyPath", testOnlyFiles::getAsPath);
185+
test.environment("es.entitlement.testOnlyPath", testOnlyFiles.getAsPath());
186186
}
187187

188188
test.systemProperties(getProviderFactory().systemPropertiesPrefixedBy("tests.").get());

test/framework/src/main/java/org/elasticsearch/entitlement/bootstrap/TestEntitlementBootstrap.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ private static TestPolicyManager createPolicyManager(PathLookup pathLookup) thro
122122

123123
FilesEntitlementsValidation.validate(pluginPolicies, pathLookup);
124124

125-
String testOnlyPathProperty = System.getProperty("es.entitlement.testOnlyPath");
125+
String testOnlyPathString = System.getenv("es.entitlement.testOnlyPath");
126126
Set<String> testOnlyClassPath;
127-
if (testOnlyPathProperty == null) {
127+
if (testOnlyPathString == null) {
128128
testOnlyClassPath = Set.of();
129129
} else {
130-
testOnlyClassPath = Arrays.stream(testOnlyPathProperty.split(":")).collect(toCollection(TreeSet::new));
130+
testOnlyClassPath = Arrays.stream(testOnlyPathString.split(":")).collect(toCollection(TreeSet::new));
131131
}
132132

133133
return new TestPolicyManager(

0 commit comments

Comments
 (0)