Skip to content

test(BA-4988): add component tests for vfolder sharing and quota#9890

Merged
HyeockJinKim merged 4 commits into
mainfrom
BA-4988
Mar 19, 2026
Merged

test(BA-4988): add component tests for vfolder sharing and quota#9890
HyeockJinKim merged 4 commits into
mainfrom
BA-4988

Conversation

@jopemachine
Copy link
Copy Markdown
Member

@jopemachine jopemachine commented Mar 11, 2026

Resolves #9846 (BA-4988)

Summary

Add component tests for VFolder sharing, invitation, and storage quota management.

Test files:

File Test Classes Count
test_vfolder_sharing.py TestVFolderSharingFlow, TestVFolderInvitationStateMachine, TestGroupFolderDirectPermissionSharing, TestShareUnshareFlow, TestSharePermissionUpdate, TestHostPermissionValidation 20
test_vfolder_quota.py TestStorageQuotaScope 6

Coverage details:

Test Class Coverage
TestVFolderSharingFlow End-to-end GROUP folder share → list → unshare
TestVFolderInvitationStateMachine PENDING → ACCEPTED/REJECTED/CANCELED transitions, list invitations
TestGroupFolderDirectPermissionSharing READ_ONLY/READ_WRITE/RW_DELETE permission sharing, DB row verification
TestShareUnshareFlow Share/unshare lifecycle, DB row removal, list_shared with/without filter
TestSharePermissionUpdate Permission level update, batch update, batch remove via null perm
TestHostPermissionValidation USER-type sharing rejection, non-owner sharing rejection, nonexistent email errors
TestStorageQuotaScope Quota get/update, usage/used-bytes query, user own quota access, non-owner quota update rejection

Total: 26 tests (17 passing, 7 xfail requiring live storage-proxy or pending server fix, 2 xfail due to SDK parsing issue)

Test plan

  • pants lint passes
  • pants check passes
  • pants test passes

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 11, 2026 03:14
@github-actions github-actions Bot added the size:XL 500~ LoC label Mar 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
assert isinstance(result, ListSharedVFoldersResponse)
assert isinstance(result, ListSharedVFoldersResponse)
assert len(result.shared) == 1

Copilot uses AI. Check for mistakes.
Comment on lines +333 to +336
@pytest.mark.xfail(
strict=False,
reason="Server returns 201 No Content but SDK expects MessageResponse body",
)
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@jopemachine jopemachine marked this pull request as draft March 11, 2026 03:24
@jopemachine jopemachine added this to the 26.3 milestone Mar 11, 2026
@jopemachine jopemachine changed the title test(BA-4988): Add VFolder sharing & quota component tests test(BA-4988): add component tests for vfolder sharing and quota Mar 11, 2026
jopemachine added a commit that referenced this pull request Mar 11, 2026
jopemachine added a commit that referenced this pull request Mar 11, 2026
jopemachine added a commit that referenced this pull request Mar 11, 2026
@jopemachine jopemachine modified the milestones: 26.3, 26.4 Mar 18, 2026
@jopemachine jopemachine requested a review from a team March 19, 2026 01:34
@jopemachine jopemachine marked this pull request as ready for review March 19, 2026 01:34
@HyeockJinKim HyeockJinKim merged commit 0ecb595 into main Mar 19, 2026
30 checks passed
@HyeockJinKim HyeockJinKim deleted the BA-4988 branch March 19, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add component tests: VFolder sharing & quota

3 participants