From 6eea7911935bdc4228c2077be1816a59750a2f86 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 6 Jan 2026 21:39:42 +0100 Subject: [PATCH 1/4] feature/enhance test reporting and build logging in workflows Add surefire report plugin and test report artifact uploads Enable pipefail in maven builds and upload build logs Remove redundant scala-test-compile execution --- .../build_container_develop_branch.yml | 41 +++++++++++++++++- .../build_container_non_develop_branch.yml | 41 +++++++++++++++++- .github/workflows/build_pull_request.yml | 41 +++++++++++++++++- obp-api/pom.xml | 43 +++++++++++++++++++ obp-commons/pom.xml | 43 +++++++++++++++++++ pom.xml | 7 --- 6 files changed, 203 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_container_develop_branch.yml b/.github/workflows/build_container_develop_branch.yml index d3f355042..ad4a1cba6 100644 --- a/.github/workflows/build_container_develop_branch.yml +++ b/.github/workflows/build_container_develop_branch.yml @@ -41,6 +41,7 @@ jobs: cache: maven - name: Build with Maven run: | + set -o pipefail cp obp-api/src/main/resources/props/sample.props.template obp-api/src/main/resources/props/production.default.props echo connector=star > obp-api/src/main/resources/props/test.default.props echo starConnector_supported_types=mapped,internal >> obp-api/src/main/resources/props/test.default.props @@ -76,7 +77,44 @@ jobs: echo ResetPasswordUrlEnabled=true >> obp-api/src/main/resources/props/test.default.props echo consents.allowed=true >> obp-api/src/main/resources/props/test.default.props - MAVEN_OPTS="-Xmx3G -Xss2m" mvn clean package -Pprod + MAVEN_OPTS="-Xmx3G -Xss2m" mvn clean package -Pprod 2>&1 | tee maven-build.log + + - name: Report failing tests (if any) + if: always() + run: | + echo "Checking build log for failing tests via grep..." + if [ ! -f maven-build.log ]; then + echo "No maven-build.log found; skipping failure scan." + exit 0 + fi + if grep -n "\*\*\* FAILED \*\*\*" maven-build.log; then + echo "Failing tests detected above." + exit 1 + else + echo "No failing tests detected in maven-build.log." + fi + + - name: Upload Maven build log + if: always() + uses: actions/upload-artifact@v4 + with: + name: maven-build-log + if-no-files-found: ignore + path: | + maven-build.log + + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-reports + if-no-files-found: ignore + path: | + obp-api/target/surefire-reports/** + obp-commons/target/surefire-reports/** + **/target/scalatest-reports/** + **/target/site/surefire-report.html + **/target/site/surefire-report/* - name: Save .war artifact run: | @@ -116,4 +154,3 @@ jobs: COSIGN_PASSWORD: "${{secrets.COSIGN_PASSWORD}}" - diff --git a/.github/workflows/build_container_non_develop_branch.yml b/.github/workflows/build_container_non_develop_branch.yml index 946d81de4..972b82e3f 100644 --- a/.github/workflows/build_container_non_develop_branch.yml +++ b/.github/workflows/build_container_non_develop_branch.yml @@ -40,6 +40,7 @@ jobs: cache: maven - name: Build with Maven run: | + set -o pipefail cp obp-api/src/main/resources/props/sample.props.template obp-api/src/main/resources/props/production.default.props echo connector=star > obp-api/src/main/resources/props/test.default.props echo starConnector_supported_types=mapped,internal >> obp-api/src/main/resources/props/test.default.props @@ -75,7 +76,44 @@ jobs: echo ResetPasswordUrlEnabled=true >> obp-api/src/main/resources/props/test.default.props echo consents.allowed=true >> obp-api/src/main/resources/props/test.default.props - MAVEN_OPTS="-Xmx3G -Xss2m" mvn clean package -Pprod + MAVEN_OPTS="-Xmx3G -Xss2m" mvn clean package -Pprod 2>&1 | tee maven-build.log + + - name: Report failing tests (if any) + if: always() + run: | + echo "Checking build log for failing tests via grep..." + if [ ! -f maven-build.log ]; then + echo "No maven-build.log found; skipping failure scan." + exit 0 + fi + if grep -n "\*\*\* FAILED \*\*\*" maven-build.log; then + echo "Failing tests detected above." + exit 1 + else + echo "No failing tests detected in maven-build.log." + fi + + - name: Upload Maven build log + if: always() + uses: actions/upload-artifact@v4 + with: + name: maven-build-log + if-no-files-found: ignore + path: | + maven-build.log + + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-reports + if-no-files-found: ignore + path: | + obp-api/target/surefire-reports/** + obp-commons/target/surefire-reports/** + **/target/scalatest-reports/** + **/target/site/surefire-report.html + **/target/site/surefire-report/* - name: Save .war artifact run: | @@ -111,4 +149,3 @@ jobs: COSIGN_PASSWORD: "${{secrets.COSIGN_PASSWORD}}" - diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index 859d309ec..61d1e05a5 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -36,6 +36,7 @@ jobs: cache: maven - name: Build with Maven run: | + set -o pipefail cp obp-api/src/main/resources/props/sample.props.template obp-api/src/main/resources/props/production.default.props echo connector=star > obp-api/src/main/resources/props/test.default.props echo starConnector_supported_types=mapped,internal >> obp-api/src/main/resources/props/test.default.props @@ -65,14 +66,50 @@ jobs: echo COUNTERPARTY_OTP_INSTRUCTION_TRANSPORT=dummy >> obp-api/src/main/resources/props/test.default.props echo SEPA_CREDIT_TRANSFERS_OTP_INSTRUCTION_TRANSPORT=dummy >> obp-api/src/main/resources/props/test.default.props - echo allow_oauth2_login=true >> obp-api/src/main/resources/props/test.default.props echo oauth2.jwk_set.url=https://www.googleapis.com/oauth2/v3/certs >> obp-api/src/main/resources/props/test.default.props echo ResetPasswordUrlEnabled=true >> obp-api/src/main/resources/props/test.default.props echo consents.allowed=true >> obp-api/src/main/resources/props/test.default.props - MAVEN_OPTS="-Xmx3G -Xss2m" mvn clean package -Pprod + MAVEN_OPTS="-Xmx3G -Xss2m" mvn clean package -Pprod 2>&1 | tee maven-build.log + + - name: Report failing tests (if any) + if: always() + run: | + echo "Checking build log for failing tests via grep..." + if [ ! -f maven-build.log ]; then + echo "No maven-build.log found; skipping failure scan." + exit 0 + fi + if grep -n "\*\*\* FAILED \*\*\*" maven-build.log; then + echo "Failing tests detected above." + exit 1 + else + echo "No failing tests detected in maven-build.log." + fi + + - name: Upload Maven build log + if: always() + uses: actions/upload-artifact@v4 + with: + name: maven-build-log + if-no-files-found: ignore + path: | + maven-build.log + + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-reports + if-no-files-found: ignore + path: | + obp-api/target/surefire-reports/** + obp-commons/target/surefire-reports/** + **/target/scalatest-reports/** + **/target/site/surefire-report.html + **/target/site/surefire-report/* - name: Save .war artifact run: | diff --git a/obp-api/pom.xml b/obp-api/pom.xml index 535178da8..f95ecd77e 100644 --- a/obp-api/pom.xml +++ b/obp-api/pom.xml @@ -597,6 +597,49 @@ + + + org.apache.maven.plugins + maven-surefire-report-plugin + 3.5.2 + + ${project.build.directory}/surefire-reports + ${project.build.directory}/surefire-reports + + + + surefire-html-report + package + + report-only + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + delete-surefire-xml-after-html + verify + + run + + + + + + + + + + + + + diff --git a/obp-commons/pom.xml b/obp-commons/pom.xml index eac3d3709..33e671979 100644 --- a/obp-commons/pom.xml +++ b/obp-commons/pom.xml @@ -125,6 +125,49 @@ + + org.apache.maven.plugins + maven-surefire-report-plugin + 3.5.2 + + ${project.build.directory}/surefire-reports + ${project.build.directory}/surefire-reports + + + + surefire-html-report + package + + report-only + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + delete-surefire-xml-after-html + verify + + run + + + + + + + + + + + + + + org.apache.maven.plugins maven-resources-plugin diff --git a/pom.xml b/pom.xml index f179b8559..b106356a1 100644 --- a/pom.xml +++ b/pom.xml @@ -155,13 +155,6 @@ testCompile - - scala-test-compile - process-test-resources - - testCompile - - From e7a13797af67e90f3fe8d7d33e108b9947b0c78b Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 6 Jan 2026 23:32:45 +0100 Subject: [PATCH 2/4] reafctor/add test failure ignore property to maven config Add maven.test.failure.ignore property to control test execution behavior --- obp-api/pom.xml | 1 + obp-commons/pom.xml | 1 + pom.xml | 1 + 3 files changed, 3 insertions(+) diff --git a/obp-api/pom.xml b/obp-api/pom.xml index f95ecd77e..7af24246b 100644 --- a/obp-api/pom.xml +++ b/obp-api/pom.xml @@ -588,6 +588,7 @@ WDF TestSuite.txt -Drun.mode=test -XX:MaxMetaspaceSize=512m -Xms512m -Xmx512m --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.jar=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED code.external + ${maven.test.failure.ignore} diff --git a/obp-commons/pom.xml b/obp-commons/pom.xml index 33e671979..be3797110 100644 --- a/obp-commons/pom.xml +++ b/obp-commons/pom.xml @@ -115,6 +115,7 @@ WDF TestSuite.txt -Drun.mode=test -XX:MaxMetaspaceSize=512m -Xms512m -Xmx512m code.external + ${maven.test.failure.ignore} diff --git a/pom.xml b/pom.xml index b106356a1..082e269b9 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ UTF-8 ${project.build.sourceEncoding} + true 1.2-m1 scaladocs/ From b902ad19beff423a05b5fadc809f22a90c58f21f Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Wed, 7 Jan 2026 17:17:59 +0100 Subject: [PATCH 3/4] Update cosign-installer action version --- .github/workflows/build_container_non_develop_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_non_develop_branch.yml b/.github/workflows/build_container_non_develop_branch.yml index 972b82e3f..ac188991e 100644 --- a/.github/workflows/build_container_non_develop_branch.yml +++ b/.github/workflows/build_container_non_develop_branch.yml @@ -132,7 +132,7 @@ jobs: docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags echo docker done - - uses: sigstore/cosign-installer@main + - uses: sigstore/cosign-installer@4d14d7f17e7112af04ea6108fbb4bfc714c00390 - name: Write signing key to disk (only needed for `cosign sign --key`) run: echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key From 517f39e9c507c881e6702efbe0efc9479b02180b Mon Sep 17 00:00:00 2001 From: tesobe-daniel Date: Wed, 7 Jan 2026 17:19:20 +0100 Subject: [PATCH 4/4] Update cosign-installer action version --- .github/workflows/build_container_develop_branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_container_develop_branch.yml b/.github/workflows/build_container_develop_branch.yml index ad4a1cba6..3afc3d6ec 100644 --- a/.github/workflows/build_container_develop_branch.yml +++ b/.github/workflows/build_container_develop_branch.yml @@ -133,7 +133,7 @@ jobs: docker push docker.io/${{ env.DOCKER_HUB_ORGANIZATION }}/${{ env.DOCKER_HUB_REPOSITORY }} --all-tags echo docker done - - uses: sigstore/cosign-installer@main + - uses: sigstore/cosign-installer@4d14d7f17e7112af04ea6108fbb4bfc714c00390 - name: Write signing key to disk (only needed for `cosign sign --key`) run: echo "${{ secrets.COSIGN_PRIVATE_KEY }}" > cosign.key