maiflai / gradle-scalatest

A plugin to enable the use of scalatest in a gradle Scala project.
The Unlicense
73 stars 35 forks source link

How to show only failed tests? #66

Closed provegard closed 6 years ago

provegard commented 6 years ago

I'm using version 0.22.

I'd like to show only failed tests in the output from gradle test.

Here are things I have tried inside the test task:

logging.level = LogLevel.ERROR

This resulted in no tests being shown at all. The test run failed due to failed tests though.

testLogging {
    events "failed"
}

This showed all tests, also the successful ones.

testLogging {
    info.events = ["failed"]
}

This showed all tests, also the successful ones.

logging.level = LogLevel.ERROR
testLogging {
    error.events = ["failed"]
}

No tests were shown at all.

maiflai commented 6 years ago

I think this is a bug - the code should probably inspect the current logging level to determine the appropriate events.

Please can you try setting the overall events?


testLogging {
  events = ['FAILED']
}```
provegard commented 6 years ago

That worked! Odd that Gradle didn't complain syntax-wise about my first variant.

Thanks!

maiflai commented 6 years ago

No worries, I think the first variant is valid. I expect you can configure it such that running with --debug or --info behave differently.

Unfortunately I've not actually tested the detailed behaviour of Gradle's native test task, I didn't have time.