FINERACT-2181: Fix github actions not failing test runs on failed tests
- added validation for cumulative multidisburse loan applications for interest method - test fixes
This commit is contained in:
@@ -95,13 +95,22 @@ jobs:
|
||||
|
||||
- name: Run Gradle Task
|
||||
run: |
|
||||
set -e # Fail the script if any command fails
|
||||
SHARD_INDEX=$(echo "${{ matrix.task }}" | awk -F'-' '{print $3}')
|
||||
FAILED=0
|
||||
|
||||
case "${{ matrix.task }}" in
|
||||
test-twofactor)
|
||||
./gradlew --no-daemon :twofactor-tests:test -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer
|
||||
if ! ./gradlew --no-daemon :twofactor-tests:test -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
|
||||
echo "::error::Two-factor tests failed"
|
||||
FAILED=1
|
||||
fi
|
||||
;;
|
||||
test-oauth2)
|
||||
./gradlew --no-daemon :oauth2-tests:test -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer
|
||||
if ! ./gradlew --no-daemon :oauth2-tests:test -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
|
||||
echo "::error::OAuth2 tests failed"
|
||||
FAILED=1
|
||||
fi
|
||||
;;
|
||||
test-core-*)
|
||||
echo "Grouping test classes by module..."
|
||||
@@ -112,7 +121,7 @@ jobs:
|
||||
done < "shard-tests_${SHARD_INDEX}.txt"
|
||||
|
||||
for module in "${!module_tests[@]}"; do
|
||||
echo "Running tests in $module:"
|
||||
echo "::group::Running tests in $module"
|
||||
for class in ${module_tests[$module]}; do
|
||||
echo " - $class"
|
||||
done
|
||||
@@ -121,11 +130,21 @@ jobs:
|
||||
test_args=$(for class in ${module_tests[$module]}; do echo --tests "$class"; done | xargs)
|
||||
|
||||
# Run test task for this module
|
||||
./gradlew "$module:test" $test_args -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer
|
||||
if ! ./gradlew "$module:test" $test_args -PdbType=postgresql -x checkstyleJmh -x checkstyleMain -x checkstyleTest -x spotlessCheck -x spotlessApply -x spotbugsMain -x spotbugsTest -x javadoc -x javadocJar -x modernizer; then
|
||||
echo "::error::Tests failed in module $module"
|
||||
FAILED=1
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
# Exit with failure status if any test failed
|
||||
if [ "$FAILED" -eq 1 ]; then
|
||||
echo "::error::Some tests failed in this job"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Archive test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
|
||||
Reference in New Issue
Block a user