Repository navigation
test(metrics): fix MetricGroupResourceTest PATCH test failing on main - #37110
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟢 Low risk · Adds a repository-read stub only in a test; production behavior is unchanged, so the impact is limited to PATCH test setup. Test-only fix stubs the original group read in the MetricGroupResourceTest PATCH sanitize test, resolving the null-conversion failure on main. No issues found. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
MetricGroupResourceTest.patchResponseSanitizesMembershipAndStillHidesMembersfails onmainand on every PR'sopenmetadata-service-unit-testsjob:Cause: #36955 made
MetricGroupResource.patchread the stored group withrepository.get(...)and apply the patch to it before authorizing. The test (added in #36764) only stubsgetWithMembers, so the mockedgetreturnsnullandapplyPatch(null, …)throws. Each PR was green on its own.Fix: stub
repository.get(any(), eq(groupId), any())to return the original, the same way the other PATCH tests in this class do. Test-only change.Verification:
MetricGroupResourceTestfails locally on currentmain(1 error) and passes with this change;MetricGroupResourceTest+MetricResourceTest37/37 green; spotless clean.