fix: inject berlin_group_v1_3_alias_path for local test runs - #2906
Closed
hongwei1 wants to merge 1 commit into
Closed
fix: inject berlin_group_v1_3_alias_path for local test runs#2906hongwei1 wants to merge 1 commit into
hongwei1 wants to merge 1 commit into
Conversation
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.
|
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
code.util.ApiVersionUtilsTestassertsApiVersionUtils.versions.length shouldBe(21).On a clean local checkout of
developthis fails with "20 was not equal to 21",while CI passes. Root cause:
test.default.propsis gitignored and eachdeveloper 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_pathset,OBP_BERLIN_GROUP_1_3_Aliasreports an empty
ScannedApiVersion("","",""), andScannedApis.isAddressablefilters it out ofversionMapScannedApisentirely — 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 inrun_tests_parallel.sh'srun_shardfunction, mirroring the exact patternalready 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.getPropsValuegivesOBP_*env vars priority over the props file, so this closes the gapwithout touching the developer's local, gitignored props file.
Testing
Reproduced the failure on a clean
origin/developcheckout (commita98ba9847d843c6717f7f7aaa6c5cf6488819c9a) with the env var unset — failswith "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_sharduses (mvn scalatest:test -pl obp-api -DwildcardSuites=code.util.ApiVersionUtilsTestwith 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.