Skip to content

test(files): stabilize CachePermissionsMask tests#61725

Draft
joshtrichards wants to merge 3 commits into
masterfrom
jtr/tests-CachePermissionsMask-fix
Draft

test(files): stabilize CachePermissionsMask tests#61725
joshtrichards wants to merge 3 commits into
masterfrom
jtr/tests-CachePermissionsMask-fix

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Jul 2, 2026

Copy link
Copy Markdown
Member
  • Resolves: (transient test/CI failures) #

Summary

Remove the pre-created foo folder from CachePermissionsMaskTest::setUp() so inherited CacheTest cases 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:

  • adding explicit coverage for direct get() on scanned file and folder entries
  • verifying scan_permissions is populated from original permissions
  • verifying existing scan_permissions values are not overwritten

This 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

  • Backport to at least v34

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Footnotes

  1. Example CI failure: https://github.com/nextcloud/server/actions/runs/28551681637/job/84737184657?pr=61707

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant