Integration tests: optionally generate surefire reports
@@ -24,6 +24,9 @@ if [ -z "${HOP_LOCATION}" ]; then
HOP_LOCATION=/opt/hop
fi
+if [ -z "${SUREFIRE_REPORT}" ]; then
+ SUREFIRE_REPORT="true"
+fi
# Get database parameters
if [ -z "${POSTGRES_HOST}" ]; then
@@ -46,7 +49,6 @@ if [ -z "${POSTGRES_PASSWORD}" ]; then
POSTGRES_PASSWORD=hop_password
fi
-
#set global variables
SPACER="==========================================="
@@ -189,12 +191,16 @@ for d in "${CURRENT_DIR}"/../*/ ; do
echo "Total duration: $total_duration"
#create final report
+ if [ "${SUREFIRE_REPORT}" == "true" ]
+ then
+
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > "${CURRENT_DIR}"/../surefire-reports/surefile_${PROJECT_NAME}.xml
echo "<testsuite xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd\" version=\"3.0\" name=\"${PROJECT_NAME}\" time=\"$total_duration\" tests=\"$test_counter\" errors=\"$errors_counter\" skipped=\"$skipped_counter\" failures=\"$failures_counter\">" >> "${CURRENT_DIR}"/../surefire-reports/surefile_${PROJECT_NAME}.xml
cat ${TMP_TESTCASES} >> "${CURRENT_DIR}"/../surefire-reports/surefile_${PROJECT_NAME}.xml
echo "</testsuite>" >> "${CURRENT_DIR}"/../surefire-reports/surefile_${PROJECT_NAME}.xml
fi
+ fi
done
# Cleanup config and audit folders
