Explore bundling external test media into Dockerfile.test #18
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ModernLeft/athena-file#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
make test(the default suite, excludesslow/largescale) currently requires two external files intests/data/:NASA launches Artemis I on 11-16-2022.mp4— 6.4 MB (archive.org)Capital-Volume-I.pdf— 4.3 MB (marxists.org)These are referenced by
tests/test_thumbnails/test_pdf_thumbs.py:23andtests/test_thumbnails/test_video_thumbs.py:23with hardcoded paths and noskipifgate, so the affected tests fail outright when the files are missing. Compare totests/test_main.py:106-109(test_exif_data), which correctly usespytest.mark.skipif(not Path("tests/data/msl-images.zip").exists()).CI handles the gap in
.forgejo/workflows/test.yml:32-43viaactions/cache@v5keyed ontest-media-cache-v1, falling back towgetfrom archive.org and marxists.org on cache miss. Local containerized runs usemake test-slow, which mountstests/dataread-only into the test image (Makefile:13-14).Why defer
The real-world driver for hardening this — migrating the old Omeka vault — will mostly involve single files, so the current external-fixture flow is good enough for now. Worth revisiting once we hit a scenario where CI flakiness from archive.org / marxists.org outages, or onboarding friction from missing fixtures, becomes a real cost.
Options to consider when picking this up
Dockerfile.testviaADD <url> tests/data/.... Removes the wget step from CI; Docker layer cache replaces the GH Actions cache. Doesn't touch the sharedathena-archive-cibase image (which is also consumed by the FE a11y crawl, so bloating it for backend-only fixtures is a non-starter).tests/data/. Removes the network dependency entirely and shrinks the test surface. Requires confirming the smaller fixtures still exercise the sameThumbnailGeneratorcode paths.skipifgates totest_pdf_thumbs.py/test_video_thumbs.pyto matchtest_exif_data's pattern. Cheapest fix; doesn't solve CI's network dependency, only the local-dev failure mode.Option 2 is probably the best long-term answer; option 1 is a smaller intermediate step that keeps the existing fixtures.
Acceptance
Dockerfile.test.make testshould pass on a fresh checkout with no manual download step, and thewgetblock in.forgejo/workflows/test.ymlshould be removable.Closing — single-dev project, tests/data/ is always present locally. CI side is handled by actions/cache from #21. Original concern (loud failures on missing fixtures) is no longer a real cost.