junit.testlogger
junit.testlogger copied to clipboard
Add system-err and system-out to testcase
- This should fix #41
- Switches to the Jenkins JUnit 5 xsd, which required the removal of the empty
propertiestag - Add stdout/stderr to
system-outandsystem-errtags to individual test cases
The other thing I think we need here is to change the documentation in the main readme to reflect the change in the schema we are using.
It should also clarify that the system-out will show up at the test case level AND at the file level. I don't have any good ideas on how to prevent this duplication.
@mclayton7 Do you want to circle back to finish this? If you don't have time I will see if I can move it forward.
@Siphonophora sorry I lost track of this, I started looking into how other test runners worked in this repository: https://github.com/mclayton7/dotnet_test_output_reporting which led me down the rabbit hole of GitHub actions. I'll pick this back up and try to finish it this weekend!
@mclayton7 No worries. I appreciate the help.
Is this MR still alive? last updates were from 2021.
I have an urgent requirement to provide a way to supress and redirect std-our and std-error from the test results XML to a separate file and wondered if I should pick up from here or start fresh?
Background:
We have multiple test suites generating 170-250 mb of std-out/err per suite. Gitlab completely chokes on such large results files.
We obviously need the output for debugging and diagnostics so suppression on its own isn't good enough, I want to redirect to a secondary log file instead and expose as a build artefact.
Thanks
@davetheninja This one isn't dead per se, but I think what you are talking about is a different change altogether. It seems like what you really need is a feature flag to suppress logging of all std/error out in the junit report. That would be a simple change, and I could see it making sense to do.
For the other piece, I don't think this logger should do redirection. I would suggest taking a look at the trx or html loggers that are built into vstest. https://github.com/microsoft/vstest-docs/blob/main/docs/report.md
You can run more than one logger at a time dotnet test --logger:"junit" --logger:"trx", so you can still run the junit one for the benefit of gitlab. But then you have the trx file which would give you both the console output AND all the the available context and test results to go with it.
Yes, actually came to same conclusion after going through the code. Redirection doesn’t fit the contract for the serialiser. That being said, suppression is not an option for me, I need the data available. Have come up with a possible solution which I will try tomorrow where I have the test results cml being generated as usuals, but have a .post hook in gitlab ci stage and use power shell to extract the error and out elements to two log files - removing the out err body within the results xmlThat should hopefully kill both birds with one stone.
Thanks
David