Skip to content

Tests for update_changes.py: the 90-day cutoff, same-day merges, unknown cells and new targets #116

Closed

Description

@patrickballard

scripts/update_changes.py writes data/changes.json, which the home page, the campaign pages (their Done lists) and #109's drops all build on. Its tests (in tests/test_bundled.py) cover diff() around bundled and the wheelgap switchover. Several rules in its docstring have no test:

  • entries older than 90 days are dropped (KEEP_DAYS, the cutoff in update());
  • a wheel lost and regained in two scans on the same day is no change at all (merge() keeps only cells whose first from and last to still count);
  • a cell that was or is unknown doesn't count, either way;
  • targets only in one of the two scans are skipped. This matters whenever the scan adds targets, as it did for 3.15 and 3.15t: a new target must not show up as hundreds of gained wheels;
  • packages only in one scan (entering or leaving the top 5,000) are skipped;
  • no previous.json records nothing and returns the reason.

What to do

  • Add a tests/test_update_changes.py (unittest, offline, like the others) with one test per rule above. Reuse the scan() and package() helpers' style from tests/test_bundled.py.
  • For the cutoff, write a changes.json with an entry 90 days old and one 89 days old, and check which stay.
  • No change to the script unless a test finds a bug. If one does, say so in the PR.

Activity

  1. added
    enhancement
    good first issue
    on Nov 16, 2026
  2. AdityaSreevatsaK commented on Nov 17, 2026

    @AdityaSreevatsaK
    Contributor

    Hello @patrickballard,

    I've raised PR #137 addressing this issue.

    Added nine offline regression tests covering the 90-day cutoff, same-day reversals, unknown statuses, target changes and missing scan data.

    All fork CI checks passed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions