Comments (8)
Hmm, that's not a nice behaviour from the plugin. Let me see what I can do. Thanks for reporting this.
from gradle-test-logger-plugin.
I've investigated what's happening: System.exit(5)
is being called.
I guess this is somewhat unexpected behaviour for JUnit tests but I have seen several StackOverflow posts suggest that as a way to abort the rest of the test suite so as to not waste when a fatal error has happened.
Would it be right for gradle-test-logger-plugin to catch the VM's non-zero exit code, treat that as a failed test and show the output?
Thanks.
from gradle-test-logger-plugin.
Hi @molexx, would you be able to provide an sscce for this so that I can provide an accurate fix? Thanks.
from gradle-test-logger-plugin.
Interesting. Would be good to find out what Gradle would do without the test logger plugin applied and with a configuration like this:
test {
testLogging {
showStandardStreams = true
}
}
from gradle-test-logger-plugin.
Hi @molexx, could you share a bit more detail about this please? Where is System.exit(5)
being called from? Is it in a setup method? Also what happens when you try this? Thanks. This info will be quite invaluable.
from gradle-test-logger-plugin.
Behaviour is the same for @Test
and @Before
methods which do some output before calling System.exit(5)
:
Without gradle-test-logger applied and without the above test{ testLogging { showStandardStreams=true}}
the stdout/stderr messages are not shown.
Without gradle-test-logger applied but with the above test{ testLogging { showStandardStreams=true}}
the stdout/stderr messages are shown.
With gradle-test-logger applied the test is reported as SKIPPED
(in yellow), then the expected behaviour happens: if testLogger's showStandardStreams
and showSkippedStandardStreams
are true the messages are seen.
I don't think it should be detected as SKIPPED
though, as the test suite's VM aborted without the test completing and with status 5 (which gradle notices and reports as in the first post).
@BeforeClass
methods are similar without gradle-test-logger - with test{ testLogging { showStandardStreams=true}}
the outputs show.
But with gradle-test-logger applied, even with all options set to true:
testlogger {
showStandardStreams true
showPassedStandardStreams true
showSkippedStandardStreams true
showFailedStandardStreams true
}
the System.out and System.err in the @BeforeClass method are not seen.
from gradle-test-logger-plugin.
I don't think it should be detected as SKIPPED though, as the test suite's VM aborted without the test completing and with status 5 (which gradle notices and reports as in the first post).
Unfortunately, there is nothing the plugin can do about this as this is Gradle's internal behaviour. I have fixed the missing system out issue though. It was a genuine bug, thanks for reporting it and the detailed analysis 👍
from gradle-test-logger-plugin.
Ah ok seeing the messages is the main thing, thanks! :-)
from gradle-test-logger-plugin.
Related Issues (20)
- Add option to filter full stacktrace HOT 2
- Plugin [id: 'com.adarshr.test-logger', version: '1.7.0'] was not found in any of the following sources HOT 2
- does this work with android espresso? aka instrumented android tests? HOT 6
- How do you group tests by class? HOT 2
- Disable logging of test cases HOT 2
- Show execution time of whole test class HOT 2
- Print class name in the same line as the test name HOT 1
- Ordered output of parallel test run HOT 1
- Detect if a terminal supports colours
- Upgrade to Gradle 7.5.x
- Output to file HOT 4
- Mocha Theme but without Color HOT 1
- add an option to show test failures in summary HOT 5
- Output Code Coverage from Jacoco HOT 1
- Hide test platform tag
- The `Provider.forUseAtConfigurationTime` method has been deprecated. HOT 4
- Unable to see testlogger options in my unit test runs HOT 11
- Support Configuration Cache HOT 1
- Can we hacve LICENSE in META-INF
- 4.0.0 Not present in standard maven repo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-test-logger-plugin.