-
-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to print output of passed tests in Reporters #586
Conversation
Hi @williammartin, Please see issue #583 for more details. |
Hi @manosnoam, I think the general idea of enabling I think there's probably some missing tests in That said, I don't love the idea of introducing a reporter specific flag. I wonder whether any of the following options are better:
I think there are advantages and disadvantages to all of these options. Let me know your thoughts. |
@williammartin, thanks for super fast reply! I guess there's a way to add test of this flag, can you suggest how to test this CLI flag ? |
I think these are maybe just two sides of the same coin. The console output is the default reporter that you can combine with other reporters. What I'm suggesting is maybe
yeh I think this what bothers me though, for example when I look at https://github.com/onsi/ginkgo/pull/586/files#diff-245d401c0f93bef3b7927b60d3418905L303 there's no reason that a reporter abstraction should leak into this thing that knows how to run specs. Similarly, this is behaviour that should probably not be solely useful for the junit reporter but also for default or teamcity (or any other custom reporter).
Ideally we would have an integration test that actually exercises a test suite using this feature, but at the very least I would expect to see something in https://github.com/onsi/ginkgo/blob/master/reporters/junit_reporter_test.go#L79-L92 that ensures a Hope this helps. |
|
9378a22
to
07137e3
Compare
Hi @williammartin, @joestringer
All Travis-CI tests are now passing. I don't see the "Request" button to ask for review, not sure what's the process here... |
82dcb6b
to
5860cdd
Compare
I had a play around and it seems to make sense to me. Thanks! |
I think there's something funny going on with the commits in this PR though, can you rebase to just one commit describing this change? |
A new CLI option: -ginkgo.reportPassed It will print output for each passed test in the generated report, including JUnit, Teamcity, and Default reporters. For example, in JUnit (XML), the test output will be added under: `<testcase> <passed>` The default behavior (without this option), prints test output only if the test case (spec) has failed. [Fixes onsi#583]
Thanks @williammartin, got this fixed and rebased. Can it be merged now ? |
In onsi#586, the JUnit reporter was extended to capture the output of passing tests when the -reportPassing flag is used. However, the passed element is not in the JUnit XML schema. While that alone might a theoretical problem, it is also a practical problem, because some parsers, e.g., the TeamCity XML Reporting Plugin JUnit parser, conform to that schema, ignore the element, and show no output for passing tests. The fix seems to be to use the system-out element instead. I have confirmed that, when using the system-out attribute, the TeamCity XML Reporting Plugin Junit parser shows output for a passing test.
In #586, the JUnit reporter was extended to capture the output of passing tests when the -reportPassing flag is used. However, the passed element is not in the JUnit XML schema. While that alone might a theoretical problem, it is also a practical problem, because some parsers, e.g., the TeamCity XML Reporting Plugin JUnit parser, conform to that schema, ignore the element, and show no output for passing tests. The fix seems to be to use the system-out element instead. I have confirmed that, when using the system-out attribute, the TeamCity XML Reporting Plugin Junit parser shows output for a passing test.
This is PR for issue #583
A new CLI option: -ginkgo.reportPassed :
It will print output for each passed test in the generated report,
including JUnit, Teamcity, and Default reporters.
For example, in JUnit (XML), the test output will be added under:
<testcase> <passed>
The default behavior (without this option), prints test output
only if the test case (spec) has failed.