Skip to content

fix: inject berlin_group_v1_3_alias_path for local test runs - #2906

Closed
hongwei1 wants to merge 1 commit into
OpenBankProject:developfrom
hongwei1:fix/local-test-berlin-group-alias-prop
Closed

fix: inject berlin_group_v1_3_alias_path for local test runs#2906
hongwei1 wants to merge 1 commit into
OpenBankProject:developfrom
hongwei1:fix/local-test-berlin-group-alias-prop

Conversation

@hongwei1

@hongwei1 hongwei1 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

code.util.ApiVersionUtilsTest asserts ApiVersionUtils.versions.length shouldBe(21).
On a clean local checkout of develop this fails with "20 was not equal to 21",
while CI passes. Root cause: test.default.props is gitignored and each
developer maintains their own local copy, so it silently drifts from what
CI's "Setup props" step injects (.github/workflows/build_pull_request.yml:291,
build_container.yml:297).

Without berlin_group_v1_3_alias_path set, OBP_BERLIN_GROUP_1_3_Alias
reports an empty ScannedApiVersion("","",""), and
ScannedApis.isAddressable filters it out of versionMapScannedApis
entirely — so the local classpath scan finds 5 addressable scanned API
versions instead of 6, and ApiVersionUtils.versions (15 hardcoded +
scanned, deduplicated) comes out to 20 instead of 21.

Fix

Inject OBP_BERLIN_GROUP_V1_3_ALIAS_PATH="0.6/v1" as an env var override in
run_tests_parallel.sh's run_shard function, mirroring the exact pattern
already used for three other known local-vs-CI props gaps in the same
function (OBP_MAIL_TEST_MODE, OBP_DYNAMIC_CODE_SANDBOX_PERMISSIONS,
OBP_ALLOW_USER_GENERATED_SCALA_CODE) — APIUtil.getPropsValue gives
OBP_* env vars priority over the props file, so this closes the gap
without touching the developer's local, gitignored props file.

Testing

Reproduced the failure on a clean origin/develop checkout (commit
a98ba9847d843c6717f7f7aaa6c5cf6488819c9a) with the env var unset — fails
with "20 was not equal to 21". Set only OBP_BERLIN_GROUP_V1_3_ALIAS_PATH
(props file otherwise untouched) and re-ran the same single-suite
invocation run_shard uses (mvn scalatest:test -pl obp-api -DwildcardSuites=code.util.ApiVersionUtilsTest with the same env vars) —
passes.

Note

Found while verifying full-suite results for an unrelated PR
(#2904, deleting retired Lift-era API standards). Confirmed via a
separate clean-checkout reproduction that this failure is unconnected to
that PR's changes — filing as its own fix here rather than folding it in.

test.default.props is gitignored and each developer maintains their
own local copy, so it can silently drift from what CI's "Setup props"
step injects. Without berlin_group_v1_3_alias_path set,
OBP_BERLIN_GROUP_1_3_Alias reports an empty ScannedApiVersion and
ScannedApis.isAddressable filters it out of versionMapScannedApis
entirely, so ApiVersionUtilsTest's `versions.length shouldBe(21)`
sees only 20 registered API versions locally while CI (which does set
the prop) sees 21.

Inject OBP_BERLIN_GROUP_V1_3_ALIAS_PATH as an env var override,
mirroring how run_tests_parallel.sh already closes the same kind of
gap for mail.test.mode, dynamic_code_sandbox_permissions and
allow_user_generated_scala_code, rather than editing the developer's
local props file.

Confirmed by reproducing the failure on a clean origin/develop
checkout with the var unset, then reproducing a pass with it set.
@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

@hongwei1

hongwei1 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #2904 (commit 103d4e2) at the reviewer's request, rather than keeping this as a separate PR. Closing.

@hongwei1 hongwei1 closed this Sep 1, 2026
@hongwei1
hongwei1 deleted the fix/local-test-berlin-group-alias-prop branch September 1, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant