Skip to content

reuse files when generate report within hardlinks(#545)#547

Open
todti wants to merge 4 commits into
mainfrom
opt-and-reuse
Open

reuse files when generate report within hardlinks(#545)#547
todti wants to merge 4 commits into
mainfrom
opt-and-reuse

Conversation

@todti
Copy link
Copy Markdown
Collaborator

@todti todti commented Mar 18, 2026

reduces disk usage and I/O when generating multiple reports into the same output directory by reusing identical files via hardlinks instead of writing duplicates.

  • Adds content-hash based deduplication in FileSystemReportFiles with atomic tmp+rename and a safe fallback to regular writes when hardlinking isn’t possible.
  • Adds unit tests and an e2e check ensuring shared static assets and attachments remain accessible across multiple awesome reports (inode check on non-Windows).

Caveats / coverage notes

  • The tricky case is cache invalidation: if a path that was used as the canonical file for some content hash is later rewritten with different content, the old hash must stop pointing at that path. The implementation now drops that stale canonical mapping before writing the new file, and the unit suite covers the old content -> new content -> old content at another path scenario.
  • Writes and hardlink replacements go through a temporary file followed by rename, so readers should not observe a partially written target file.
  • Hardlinking can fail on some filesystems or environments (for example cross-device output, permissions, or missing canonical source). Those errors are treated as recoverable and fall back to a regular write.
  • Inode assertions are only meaningful on non-Windows platforms, so tests check inode reuse conditionally. On Windows the tests still validate that every report path remains readable and has the expected content.
  • The e2e coverage focuses on the multi-awesome-report case: shared static assets and global attachments must stay accessible from both report directories while avoiding duplicate inodes where the platform supports it.

refer to #545 #486

image

@todti todti added theme:build type:improvement New feature or request labels Mar 18, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 18, 2026

Allure Report Summary

Name Duration Stats New Flaky Retry Report
Allure 3 Report 25m 21s Passed tests 1440   Failed tests 12   Skipped tests 15 9 0 0 View
My Dashboard 25m 21s Passed tests 1440   Failed tests 12   Skipped tests 15 9 0 0 View
Allure 3 GitHub actions run (2026-05-29T18:21:37.609Z) 25m 21s Passed tests 1440   Failed tests 12   Skipped tests 15 9 0 0 View

@todti todti requested a review from epszaw March 30, 2026 12:17
@todti todti marked this pull request as ready for review March 30, 2026 12:17
@todti todti changed the title WIP: reuse files when generate report within hardlinks(#545) reuse files when generate report within hardlinks(#545) Mar 30, 2026
@todti todti requested a review from delatrie March 30, 2026 12:18
@jrett2
Copy link
Copy Markdown

jrett2 commented Apr 14, 2026

FYI this is a duplicate of #486

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants