test(files): stabilize CachePermissionsMask tests#61725
Draft
joshtrichards wants to merge 3 commits into
Draft
Conversation
…etup Pre-creating `foo` in `setUp()` changes the initial cache state and breaks inherited cache tests that expect a fresh entry. It's also redundant for the tests in CachePermissionsMaskTest itself which already create `foo` when needed. Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
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.
Summary
Remove the pre-created
foofolder fromCachePermissionsMaskTest::setUp()so inheritedCacheTestcases still start with the default cache contents.The test class intentionally changes the cache wrapper in
setUp(), but storage fixtures should be (and already are) created in the individual tests that need them.Also tighten permission masking coverage by:
get()on scanned file and folder entriesscan_permissionsis populated from original permissionsscan_permissionsvalues are not overwrittenThis fixes a transient failure in inherited cache tests1 while keeping the wrapper-specific behavior covered and closing coverage gaps.
The final commit only cleans up and modernizes the test class.
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)
Footnotes
Example CI failure: https://github.com/nextcloud/server/actions/runs/28551681637/job/84737184657?pr=61707 ↩