2020-11-30 07:53:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-05-11 06:50:36 +00:00
|
|
|
##
|
|
|
|
## To include test coverage data, use -Djacoco.skip=false parameter.
|
|
|
|
## This will gather the coverage data into target/jacoco.exec file and
|
|
|
|
## generate the coverage report for each module in keycloak/model/*/target/site.
|
|
|
|
##
|
|
|
|
|
2020-11-30 07:53:31 +00:00
|
|
|
cd "$(dirname $0)"
|
2024-06-03 13:45:39 +00:00
|
|
|
../../mvnw -version
|
2020-11-30 07:53:31 +00:00
|
|
|
|
|
|
|
EXIT_CODE=0
|
2024-06-03 13:45:39 +00:00
|
|
|
../../mvnw clean
|
|
|
|
for I in `perl -ne 'print "$1\n" if (m,<id>([^.<]+)</id>,)' pom.xml | grep -E -v '(report|copy-testsuite-providers-to-model-testsuite)'`; do
|
2020-11-30 07:53:31 +00:00
|
|
|
echo "========"
|
2022-02-17 10:22:17 +00:00
|
|
|
echo "======== Start of Profile $I"
|
2020-11-30 07:53:31 +00:00
|
|
|
echo "========"
|
2024-06-03 13:45:39 +00:00
|
|
|
../../mvnw -B -Dsurefire.timeout=900 test "-P$I" "$@" 2>&1 | tee /tmp/surefire.out
|
2022-01-19 21:21:57 +00:00
|
|
|
EXIT_CODE=$[$EXIT_CODE + ${PIPESTATUS[0]}]
|
2020-11-30 07:53:31 +00:00
|
|
|
mv target/surefire-reports "target/surefire-reports-$I"
|
2022-01-19 21:21:57 +00:00
|
|
|
perl -ne "print '::error::| $I | Timed out.' . \"\n\" if (/There was a timeout in the fork/)" /tmp/surefire.out
|
2022-02-17 10:22:17 +00:00
|
|
|
echo "========"
|
|
|
|
echo "======== End of Profile $I"
|
|
|
|
echo "========"
|
2020-11-30 07:53:31 +00:00
|
|
|
done
|
|
|
|
|
2021-05-11 06:50:36 +00:00
|
|
|
## If the jacoco file is present, generate reports in each of the model projects
|
2024-06-03 13:45:39 +00:00
|
|
|
[ -f target/jacoco.exec ] && ../../mvnw -f ../../model org.jacoco:jacoco-maven-plugin:0.8.7:report -Djacoco.dataFile="$(readlink -f target/jacoco.exec)"
|
2021-05-11 06:50:36 +00:00
|
|
|
|
2021-02-26 10:45:38 +00:00
|
|
|
for I in `perl -ne 'print "$1\n" if (m,<id>([^<]+)</id>,)' pom.xml`; do
|
|
|
|
grep -A 1 --no-filename '<<<' "target/surefire-reports-$I"/*.txt | perl -pe "print '::error::| $I | ';"
|
|
|
|
done
|
|
|
|
|
2020-11-30 07:53:31 +00:00
|
|
|
exit $EXIT_CODE
|