Add the ability to generate JUnit XML reports with a -J flag

If the -J flag is passed, generate JUnit XML reports for each check, in-line with how Java tools generate JUnit reports.
Check section numbers equate to 'root packages', checks are second-level packages, each check equates to a testsuite (mirroring Java where each test class is a testsuite) and each pass/fail of a check equates to a testcase
Time the execution of each check and include this in the report
Include properties (Prowler version, check level etc.) in-line with standard JUnit files
XML escape all strings for safety

Detect if a user has GNU coreutils installed on Mac OS X, but not as their default, switching to using gdate for date commands if so, as it has more features, including getting dates in milliseconds
Add prowler-output, junit-reports and VSCode files to .gitignore
Update README to include JUnit info, address markdownlint warnings
Remove unused arguments to jq in generateJsonAsffOutput

Fixes #537
This commit is contained in:
Marc Jay
2020-04-15 02:36:16 +01:00
parent 462527015c
commit 994390351e
6 changed files with 277 additions and 67 deletions

11
.gitignore vendored
View File

@@ -18,4 +18,13 @@ tags
[._]*.un~
# MacOs DS_Store
*.DS_Store
*.DS_Store
# Prowler output
prowler-output-*
# JUnit Reports
junit-reports/
# VSCode files
.vscode/