From 9e9abdf16ad83e824cdb9517a3fb94d829410b30 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 6 Jan 2026 16:54:07 +0100 Subject: [PATCH 1/5] test/fixed failed tests --- obp-api/src/main/scala/code/api/util/ErrorMessages.scala | 1 + .../src/main/scala/code/api/v6_0_0/APIMethods600.scala | 2 +- .../test/scala/code/api/v5_1_0/LogCacheEndpointTest.scala | 8 +++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala index 4c17086c1d..0a5110ebea 100644 --- a/obp-api/src/main/scala/code/api/util/ErrorMessages.scala +++ b/obp-api/src/main/scala/code/api/util/ErrorMessages.scala @@ -84,6 +84,7 @@ object ErrorMessages { val FXCurrencyCodeCombinationsNotSupported = "OBP-10004: ISO Currency code combination not supported for FX. Please modify the FROM_CURRENCY_CODE or TO_CURRENCY_CODE. " val InvalidDateFormat = "OBP-10005: Invalid Date Format. Could not convert value to a Date." val InvalidCurrency = "OBP-10006: Invalid Currency Value." + val InvalidCacheNamespaceId = "OBP-10123: Invalid namespace_id." val IncorrectRoleName = "OBP-10007: Incorrect Role name:" val CouldNotTransformJsonToInternalModel = "OBP-10008: Could not transform Json to internal model." val CountNotSaveOrUpdateResource = "OBP-10009: Could not save or update resource." diff --git a/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala b/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala index 3f8a0d05ef..b5b2c15b3d 100644 --- a/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala +++ b/obp-api/src/main/scala/code/api/v6_0_0/APIMethods600.scala @@ -635,7 +635,7 @@ trait APIMethods600 { } namespaceId = postJson.namespace_id _ <- Helper.booleanToFuture( - s"Invalid namespace_id: $namespaceId. Valid values: ${Constant.ALL_CACHE_NAMESPACES.mkString(", ")}", + s"$InvalidCacheNamespaceId $namespaceId. Valid values: ${Constant.ALL_CACHE_NAMESPACES.mkString(", ")}", 400, callContext )(Constant.ALL_CACHE_NAMESPACES.contains(namespaceId)) diff --git a/obp-api/src/test/scala/code/api/v5_1_0/LogCacheEndpointTest.scala b/obp-api/src/test/scala/code/api/v5_1_0/LogCacheEndpointTest.scala index 690464e06e..4a446b0320 100644 --- a/obp-api/src/test/scala/code/api/v5_1_0/LogCacheEndpointTest.scala +++ b/obp-api/src/test/scala/code/api/v5_1_0/LogCacheEndpointTest.scala @@ -1,7 +1,7 @@ package code.api.v5_1_0 import code.api.util.APIUtil.OAuth._ -import code.api.util.ApiRole.CanGetSystemLogCacheAll +import code.api.util.ApiRole.{CanGetSystemLogCacheAll,CanGetSystemLogCacheInfo} import code.api.util.ErrorMessages.{UserHasMissingRoles, UserNotLoggedIn} import code.api.v5_1_0.OBPAPI5_1_0.Implementations5_1_0 import code.entitlement.Entitlement @@ -41,7 +41,9 @@ class LogCacheEndpointTest extends V510ServerSetup { val response = makeGetRequest(request) Then("error should be " + UserHasMissingRoles + CanGetSystemLogCacheAll) response.code should equal(403) - response.body.extract[ErrorMessage].message should be(UserHasMissingRoles + CanGetSystemLogCacheAll) + response.body.extract[ErrorMessage].message contains (UserHasMissingRoles) shouldBe (true) + response.body.extract[ErrorMessage].message contains CanGetSystemLogCacheInfo.toString() shouldBe (true) + response.body.extract[ErrorMessage].message contains CanGetSystemLogCacheAll.toString() shouldBe (true) } } @@ -129,7 +131,7 @@ class LogCacheEndpointTest extends V510ServerSetup { val response = makeGetRequest(request) Then("We should get a not found response since endpoint does not exist") - response.code should equal(404) + response.code should equal(400) val json = response.body.extract[JObject] And("The response should contain the correct error message") From 6eea7911935bdc4228c2077be1816a59750a2f86 Mon Sep 17 00:00:00 2001 From: hongwei Date: Tue, 6 Jan 2026 21:39:42 +0100 Subject: [PATCH 2/5] 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 d3f3550424..ad4a1cba67 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 946d81de4d..972b82e3f9 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 859d309ec2..61d1e05a5a 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 535178da81..f95ecd77e2 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 eac3d3709e..33e6719792 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 f179b8559a..b106356a1c 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 3/5] 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 f95ecd77e2..7af24246b6 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 33e6719792..be37971105 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 b106356a1c..082e269b9e 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 4/5] 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 972b82e3f9..ac188991e9 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 5/5] 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 ad4a1cba67..3afc3d6ec5 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