mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
fix(junit_xml output): Fix XML output integration (#1210)
Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
@@ -84,12 +84,12 @@ execute_check() {
|
||||
fi
|
||||
fi
|
||||
show_check_title ${alternate_name}
|
||||
if is_junit_output_enabled; then
|
||||
if [[ " ${MODE} " =~ "junit-xml" ]]; then
|
||||
prepare_junit_check_output "$1"
|
||||
fi
|
||||
# Execute the check
|
||||
IGNORES="${ignores}" CHECK_NAME="$1" ${alternate_name}
|
||||
if is_junit_output_enabled; then
|
||||
if [[ " ${MODE} " =~ "junit-xml" ]]; then
|
||||
finalise_junit_check_output "$1"
|
||||
fi
|
||||
|
||||
@@ -108,13 +108,13 @@ execute_check() {
|
||||
fi
|
||||
fi
|
||||
show_check_title "$1"
|
||||
if is_junit_output_enabled; then
|
||||
if [[ " ${MODE} " =~ "junit-xml" ]]; then
|
||||
prepare_junit_check_output "$1"
|
||||
fi
|
||||
# Execute the check
|
||||
IGNORES="${ignores}" CHECK_NAME="$1" $1
|
||||
|
||||
if is_junit_output_enabled; then
|
||||
if [[ " ${MODE} " =~ "junit-xml" ]]; then
|
||||
finalise_junit_check_output "$1"
|
||||
fi
|
||||
|
||||
|
||||
@@ -20,14 +20,6 @@ JUNIT_FAILURES_COUNT="0"
|
||||
JUNIT_SKIPPED_COUNT="0"
|
||||
JUNIT_ERRORS_COUNT="0"
|
||||
|
||||
is_junit_output_enabled() {
|
||||
if [[ " ${MODE} " =~ "junit-xml" ]]; then
|
||||
true
|
||||
else
|
||||
false
|
||||
fi
|
||||
}
|
||||
|
||||
xml_escape() {
|
||||
sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/\"/\"/g; s/'"'"'/\'/g' <<< "$1"
|
||||
}
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ general_output() {
|
||||
if [[ "${SEND_TO_SECURITY_HUB}" -eq 1 ]]; then
|
||||
sendToSecurityHub "${JSON_ASFF_OUTPUT}" "${REGION_FROM_CHECK}"
|
||||
fi
|
||||
elif is_junit_output_enabled
|
||||
elif [[ "${MODE_TYPE}" == "junit-xml" ]]
|
||||
then
|
||||
if [ "${CHECK_RESULT}" == 'PASS' ]
|
||||
then
|
||||
|
||||
@@ -96,7 +96,7 @@ validate_assume_role() {
|
||||
|
||||
# JUnit output if -M junit-xml
|
||||
validate_junit_output() {
|
||||
if is_junit_output_enabled
|
||||
if [[ " ${MODE} " =~ "junit-xml" ]];
|
||||
then
|
||||
prepare_junit_output
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user