Skip to content

test(cache): expand HomeCache size behavior coverage - #65144

Open
joshtrichards wants to merge 3 commits into
masterfrom
jtr/HomeCacheTest-fixes
Open

joshtrichards wants to merge 3 commits into
masterfrom
jtr/HomeCacheTest-fixes

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Oct 5, 2026 •

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Expand HomeCacheTest coverage for home-storage-specific size reporting.

The existing tests checked files folder size calculations, but did not verify that the root reports the recalculated files-folder size too. They also did not cover the special-path behavior for files_trashbin, files_versions, or the / root alias. One test comment referred to unknown sizes that were not present in its fixture.

Changes:

  • Verify that recalculating files ignores children with unknown sizes and that the root reports the resulting files size.
  • Add a root-level file to confirm it does not affect the root's reported size.
  • Cover unknown-size handling for files_trashbin and files_versions.
  • Verify the / root alias reports the files folder size and that calculating / is a no-op.
  • Clarify test names and comments, remove unused fixture data, and simplify cleanup using recursive root removal.

TODO

  • Backport?

Checklist

AI (if applicable)

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

The existing tests checked `files` folder size calculations, but did not verify that the root also reports the recalculated `files`-folder size. One test's comment also referred to unknown sizes that were not present in its fixture.

- Assert the recalculated `files` size and the root's reported size.
- Insert a root-level file to show that it does not affect the root's reported size.
- Remove unused fixture data and redundant cleanup.

Assisted-by: Copilot:gpt-6-luna

Signed-off-by: Josh <josh.t.richards@gmail.com>
The HomeCache size-calculation behavior for `files_trashbin` and
`files_versions` was not covered.

Add data-driven tests verifying that known-size children contribute
to each folder's calculated size while children with unknown sizes
are ignored.

Assisted-by: Copilot:gpt-6-luna

Signed-off-by: Josh <josh.t.richards@gmail.com>
The slash root alias had a separate HomeCache code path from the empty root path, but its no-op size calculation and reported size were not directly tested.

Verify that calculating `/` returns zero and reading `/` reports the size of the `files` folder.

Assisted-by: Copilot:gpt-6-luna

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added this to the Nextcloud 36 milestone Oct 5, 2026
@joshtrichards
joshtrichards requested a review from a team as a code owner October 5, 2026 14:46
@joshtrichards
joshtrichards requested review from Altahrim, icewind1991, leftybournes and salmart-dev and removed request for a team October 5, 2026 14:46
@joshtrichards joshtrichards added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 6, 2026

This branch has not been deployed

No deployments
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.

3 participants