Repository navigation
Clear an earlier LAVA export's media before re-exporting into its folder - #247
Merged
Merged
Conversation
The database is rebuilt on every export but media/ and _HTML/media/ were kept, and a file already there was not copied again. A narrower re-export into the same folder therefore handed over every file the wider one held, and "Media files written" counted only this run's copies. An export into a folder that holds a LAVA database or manifest now empties its two media folders first, so the folder holds exactly what the report lists and the run log's count is the report's. A media folder beside no LAVA export is refused rather than deleted. The run log lines now read "Media files in the report" and "Media bytes in the report". Fixes #243 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #243
Each export rebuilds the LAVA database, but
media/and_HTML/media/were kept, and a file already there was not copied again. So a narrower re-export into the same folder still held every file the wider one had, and the run log's "Media files written" counted only that run's new copies._Writernow emptiesmedia/and_HTML/media/before writing when the folder already holds a LAVA database or manifest. The folder then holds exactly what the new report lists. Deleting a hardlinked copy removes only that name, never the evidence file.FileExistsError), not deleted._lava_media_items.Tests in
tests/test_lava.py:test_a_narrower_re_export_leaves_no_earlier_media_behindexports all, then the same scope again, then one file, into one folder. After each export, the database,media/,_HTML/media/and the run log count must agree.test_media_folders_that_are_not_a_lava_export_are_left_alonechecks that a foreign media folder is refused and left untouched.Both fail on
main. All 40 tests intest_lava.pypass, andlint_changed.pyreports no new warnings.🤖 Generated with Claude Code