Skip to content

Commit

Permalink
Use extra properties for configuring test output dump on error (elast…
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira authored Dec 5, 2023
1 parent 5134fab commit d795d82
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void apply(Project project) {
File testOutputDir = new File(test.getReports().getJunitXml().getOutputLocation().getAsFile().get(), "output");

ErrorReportingTestListener listener = new ErrorReportingTestListener(test, testOutputDir);
test.getInputs().property(DUMP_OUTPUT_ON_FAILURE_PROP_NAME, true);
test.getExtensions().getExtraProperties().set(DUMP_OUTPUT_ON_FAILURE_PROP_NAME, true);
test.getExtensions().add("errorReportingTestListener", listener);
test.addTestOutputListener(listener);
test.addTestListener(listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ public void close() throws IOException {
}

private boolean isDumpOutputEnabled() {
return (Boolean) testTask.getInputs()
return (Boolean) testTask.getExtensions()
.getExtraProperties()
.getProperties()
.getOrDefault(ElasticsearchTestBasePlugin.DUMP_OUTPUT_ON_FAILURE_PROP_NAME, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void apply(Project project) {
nonInputSystemProperties.systemProperty(TESTS_MAX_PARALLEL_FORKS_SYSPROP, () -> String.valueOf(task.getMaxParallelForks()));

// Disable test failure reporting since this stuff is now captured in build scans
task.getInputs().property(ElasticsearchTestBasePlugin.DUMP_OUTPUT_ON_FAILURE_PROP_NAME, false);
task.getExtensions().getExtraProperties().set(ElasticsearchTestBasePlugin.DUMP_OUTPUT_ON_FAILURE_PROP_NAME, false);

// Disable the security manager and syscall filter since the test framework needs to fork processes
task.systemProperty("tests.security.manager", "false");
Expand Down

0 comments on commit d795d82

Please sign in to comment.