Repository navigation
Test same-name files and a folder renamed by another client on real Drive - #462
Draft
shcheklein wants to merge 2 commits into
Draft
shcheklein wants to merge 2 commits into
shcheklein wants to merge 2 commits into
Conversation
Two files with one name, and a folder that another client replaced or renamed after the filesystem cached its ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shcheklein
commented
Dec 3, 2026
This was referenced Dec 3, 2026
shcheklein
commented
Dec 3, 2026
shcheklein
left a comment
Member
Author
There was a problem hiding this comment.
[AI generated — Copilot]
5-pass review summary: clean, idiomatic functional live tests with zero monkeypatching and zero internals. Main critique is creating another standalone test file that copy-pastes ~35% of its code (fixtures/helpers) from #457 instead of living in test_fs.py or sharing conftest.py fixtures.
They use its fixtures and keep the created folder object instead of listing to find it. The replaced-folder case is dropped: test_invalidating_parent_reloads_replaced_mount covers it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the added live Drive filesystem tests and supporting helpers.
No open issues 🎉
What changed in this PR
Extends live Drive filesystem coverage following #457, testing changes made by another client without modifying production code.
Changes:
- Tests duplicate-name file listing, lowest-ID selection, metadata, and removal.
- Tests that cache invalidation resolves an externally renamed folder correctly.
- Adds shared helpers for creating test items through the core Drive API.
| File | Description |
|---|---|
pydrive2/test/test_fs.py |
Adds duplicate-file and external-folder-rename tests with supporting fixtures. |
Review effort: Balanced
This branch has not been deployed
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.
The second set of live tests from the review of what CI never ran against real Drive (the first is #457). These cover a folder that another client changed: someone using the Drive web page, another DVC process, or a script. They are in
test_fs.pyand use its fixtures; the other client is the core API.Two files with one name
Drive lets two files in a folder have the same name. DVC users get them from two pushes that race, or from an upload in the web page. The guide says the filesystem then uses the file with the lowest Drive ID. Only mocks checked that; the existing live
test_ops_work_with_duplicate_namescovers duplicate folders.The tests check
ls,cat_file,info, detailedfindandrm_fileagainst real Drive.A folder renamed after the filesystem cached it
The filesystem caches folder IDs by path. The guide says to call
fs.invalidate_cache(path)after another client moves, trashes or deletes a folder. In the test, another client renamesbeforetoafterafter the filesystem listed it. Afterinvalidate_cache("root/dir/before"),beforeand its file no longer exist, and the file reads underafter. A folder replaced after caching is already covered bytest_invalidating_parent_reloads_replaced_mount.Validation
Test-only change. The tests pass against the local fake Drive as a smoke check. They describe what the guide already promises, so they are expected to pass on real Drive too. If one fails, it has found a bug, and the fix goes in its own PR.
🤖 Generated with Claude Code