fix: test fixes - #4823
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. 📝 WalkthroughWalkthroughThis PR updates test files only. Governance tests are revised so ChangesTest Assertion Updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
Confidence Score: 5/5Test-only changes that align assertions with the handler's existing behavior; no production code modified. Both files are test-only. The governance test mock and assertion changes precisely match what the handler already does (early-return from the from_memory branch without touching ConfigStore). The requestpayload fix corrects a string literal that mismatched the live error message. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix: test fixes" | Re-trigger Greptile |
The merge-base changed after approval.
5b9b1e2 to
27423a7
Compare
Merge activity
|

Summary
Fixes the
from_memoryflag behavior for the virtual keys endpoint so it correctly reads from in-memoryGovernanceDatainstead of falling through to the DB-backedConfigStore. Also corrects the casing of an invalid request payload error message.Changes
from_memoryquery parameter now routes virtual key lookups throughGetGovernanceData(in-memory path) and skips allConfigStorecalls, including the paginated variant. Previously, the flag was incorrectly routing to theConfigStoreregardless.mockGovernanceManagerForVKwas updated to hold and return a configurableGovernanceDatavalue instead of always returningnil, enabling accurate test assertions.TestGetVirtualKeys_FromMemoryUsesConfigStorewas renamed toTestGetVirtualKeys_FromMemoryUsesGovernanceDataandTestGetVirtualKeys_FromMemoryWithLimitUsesPaginatedConfigStorewas renamed toTestGetVirtualKeys_FromMemoryTakesPrecedenceOverLimitto reflect the corrected behavior. Assertions were inverted accordingly:GetGovernanceDatais now expected to be called once, andConfigStoremethods are expected to receive zero calls."invalid request payload"to"Invalid request payload"to match the actual returned string.Type of change
Affected areas
How to test
go test ./transports/bifrost-http/handlers/...Verify that
TestGetVirtualKeys_FromMemoryUsesGovernanceData,TestGetVirtualKeys_FromMemoryTakesPrecedenceOverLimit, andTestPrepareRequestInvalidPayloadDoesNotExposeDecoderDetailsall pass.Breaking changes
Security considerations
No security implications. The change ensures in-memory governance data is served when requested rather than hitting the database, which is the intended isolation behavior.
Checklist
docs/contributing/README.mdand followed the guidelines