test(BA-4988): add component tests for vfolder sharing and quota#9890
Conversation
Add component tests covering VFolder direct permission sharing, share/unshare lifecycle, permission updates, host permission validation, and storage quota operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new component-test suite to validate VFolder direct sharing behavior (including DB-side permission rows) and storage quota/usage APIs, expanding coverage for BA-4988 scenarios in the vfolder domain.
Changes:
- Added component tests for GROUP vfolder direct sharing flows (share/unshare/list/update) with DB verification against
vfolder_permissions. - Added negative tests for sharing permission validation and error cases.
- Added xfail-marked component tests for quota/usage endpoints that require live storage-proxy (and for SDK response-body mismatches).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| result = await admin_registry.vfolder.list_shared( | ||
| ListSharedVFoldersQuery(vfolder_id=group_vf["id"]), | ||
| ) | ||
| assert isinstance(result, ListSharedVFoldersResponse) |
There was a problem hiding this comment.
all(...) will evaluate to True even if result.shared is empty, so this test could pass without actually verifying that the filter returned the shared entry. Add an assertion that result.shared is non-empty (e.g., length == 1) before the all(...) check, or assert directly on the expected single returned vfolder_id.
| assert isinstance(result, ListSharedVFoldersResponse) | |
| assert isinstance(result, ListSharedVFoldersResponse) | |
| assert len(result.shared) == 1 |
| @pytest.mark.xfail( | ||
| strict=False, | ||
| reason="Server returns 201 No Content but SDK expects MessageResponse body", | ||
| ) |
There was a problem hiding this comment.
PR description says there are 6 xfail tests total, but this file currently marks 8 tests as xfail (2 for the SDK 201-empty-body issue + 6 requiring live storage-proxy). Please update the PR description counts or adjust the xfail markers so they match.
Resolves #9846 (BA-4988)
Summary
Add component tests for VFolder sharing, invitation, and storage quota management.
Test files:
test_vfolder_sharing.pyTestVFolderSharingFlow,TestVFolderInvitationStateMachine,TestGroupFolderDirectPermissionSharing,TestShareUnshareFlow,TestSharePermissionUpdate,TestHostPermissionValidationtest_vfolder_quota.pyTestStorageQuotaScopeCoverage details:
TestVFolderSharingFlowTestVFolderInvitationStateMachineTestGroupFolderDirectPermissionSharingTestShareUnshareFlowTestSharePermissionUpdateTestHostPermissionValidationTestStorageQuotaScopeTotal: 26 tests (17 passing, 7 xfail requiring live storage-proxy or pending server fix, 2 xfail due to SDK parsing issue)
Test plan
pants lintpassespants checkpassespants testpasses🤖 Generated with Claude Code