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
Support for JUNIT artifacts for results visualization. #538
Comments
👋 As it was an issue for us too, we found an alternative way to do that. Mega-Linter has an export format to # Version 5.0.0 tap-junit has breaking changes that are currently getting fixed
npm install -g tap-junit@4.2.0
mkdir report_converted/
cd ./report/tap
for report in *; do
# workaround for https://github.com/dhershman1/tap-junit/issues/30#issuecomment-744462006
'sed -i "s/message: \*\+/message: /g" $report'
# Some message got comments with # which are ignored by tap-junit, so we escape it
'sed -i -E "s/(^|[ ]+)(#)[a-zA-Z]*/\1\/\//g" $report'
# Converting TAP files into xml files with JUnit5 format
cat $report | tap-junit -p -s "mega-linter" > ../../report_converted/${report}.xml
# Remove escaping on newlines for readability
sed -i 's/\\n/\n/g' ../../report_converted/${report}.xml
# Replace ANSI colors as they are illegal characters
sed -i 's/\x1b\[[0-9;]*m//g' ../../report_converted/${report}.xml
done This little piece of code is taken from an R2devops GitLab job. |
@alexandrebrg that's great, I could use that in a JUNIT reporter :) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
Is your feature request related to a problem? Please describe.
Many CI systems support UI based test visualization and long term statics when results can be collected in JUNIT format. For example: https://gitlab.com/guided-explorations/ci-cd-plugin-extensions/checkov-iac-sast/-/pipelines/230359640/test_report
Describe the solution you'd like
JUNIT format for test result artifacts.
Describe alternatives you've considered
The text reporter functionality is the the clearest alternative but JUNIT has many other benefits (https://nvuillam.github.io/mega-linter/reporters/TextReporter/#get-artifacts-on-gitlab-ci)
Additional context
This example is not linting results - but it would display ver similarly: https://gitlab.com/guided-explorations/ci-cd-plugin-extensions/checkov-iac-sast/-/pipelines/230359640/test_report
The text was updated successfully, but these errors were encountered: