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)"
|
2021-03-11 15:55:13 +00:00
|
|
|
mvn -version
|
2020-11-30 07:53:31 +00:00
|
|
|
|
|
|
|
EXIT_CODE=0
|
|
|
|
mvn clean
|
|
|
|
for I in `perl -ne 'print "$1\n" if (m,<id>([^<]+)</id>,)' pom.xml`; do
|
|
|
|
echo "========"
|
|
|
|
echo "======== Profile $I"
|
|
|
|
echo "========"
|
2021-02-26 10:45:38 +00:00
|
|
|
mvn -B test "-P$I" "$@"
|
2020-11-30 07:53:31 +00:00
|
|
|
EXIT_CODE=$[$EXIT_CODE + $?]
|
|
|
|
mv target/surefire-reports "target/surefire-reports-$I"
|
|
|
|
done
|
|
|
|
|
2021-05-11 06:50:36 +00:00
|
|
|
## If the jacoco file is present, generate reports in each of the model projects
|
|
|
|
[ -f target/jacoco.exec ] && mvn -f ../../model org.jacoco:jacoco-maven-plugin:0.8.7:report -Djacoco.dataFile="$(readlink -f target/jacoco.exec)"
|
|
|
|
|
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
|