Skip to content

Support JUnit platform reporting entries #4605

@jlink

Description

@jlink

When a failing test also publishes report entries, those should be displayed.

Expected Behavior

The junit platform TestExecutionListener has a method reportingEntryPublished which is called when tests report additional data. Those entries should be displayed/logged in gradle's output when a test fails. They should also show up in the generated html report.

Current Behavior

Nothing is shown.

Context

IntelliJ, Eclipse, Maven and the junit-platform-gradle-plugin actually report the entries.

Those entries usually give important additional information to interpret test results.
For example, jqwik (http://jqwik.net) uses those entries to report the random seed
which is needed to reproduce errors.

Steps to Reproduce (for bugs)

Running the following test through gradle should not only report a failure but also something
like timestamp = 2018-03-06T15:40:33.704, key = value (IntelliJ's output)

@Test
void failingTestWithReporting(TestReporter reporter) {
	reporter.publishEntry("key", "value");
	org.junit.jupiter.api.Assertions.fail("Fails with an additional report entry");
}

Your Environment

OSX, Java 8, Gradle 4.6

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions