Add CI + dev deps; fix test nondeterminism; guard artifact/date-kind drift - #5
Merged
Merged
Conversation
…drift Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Follow-up to the code review of PRs #1–#4. Addresses the gaps that weren't covered there: test reproducibility, missing CI, and unguarded drift risks. No production/UI code changes — only tests, tooling, and CI.
1. Test nondeterminism (from PR #4 review).
test_generation.pyseeded per-entry RNGs with the built-inhash(title), which is salted per process (PYTHONHASHSEED), sorun_tests(seed=42)was not actually reproducible run-to-run (reproduced: 3 runs of the same "seeded" call gaveIMG 1828 / 3307 / 9255). Replaced with a stable digest:test_common.pyverifies it via subprocess under two differentPYTHONHASHSEEDvalues → identical output.2.
DATE_KIND_TO_YMDcoverage guard (from PR #2 review). Nothing enforced thatDATE_KIND_TO_YMDcovers every date kind exceptyear; a future kind added toDATE_KIND_LABELSbut notDATE_KIND_TO_YMDwould makegenerate_fromsilently fall through to emitting the raw title. Addedtest_common.py:3. Artifact-sync guard (from PR #1 review).
data.json,data.min.json, andindex.htmlare generated together but committed as static files, so they can silently drift. Addedtest_artifacts.py:data.json == data.min.jsonindex.htmldecodes back todata.min.jsonindex.htmlfrom the committeddata.min.jsonreproduces it byte-for-byte4. Dev deps + CI (from PR #1 review).
pytest/coverageweren't declared anywhere and there was no committed CI workflow, so the tests weren't wired to run automatically. Addedrequirements-dev.txtand.github/workflows/ci.yml(Python 3.10–3.12) runningpython3 test_generation.pyandpytest.Verification
python3 -m pytest -q→ 84 passed (77 existing + 7 new).python3 test_generation.py→PASS rubric (452 entries, seed=42).generate_fromoutput underPYTHONHASHSEED=1and999.Link to Devin session: https://app.devin.ai/sessions/c699ea7702c843db9106e378612ebdcb
Requested by: @XVVH