Skip to content

test(server): guard long-event overlap consumers - #215

Draft
TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:test/long-event-overlap
Draft

TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:test/long-event-overlap

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

Summary

Integration regressions for #213 and ActivityWatch/aw-core#194; depends on core repair ActivityWatch/aw-core#197.

Adds real Flask HTTP tests against a disposable Peewee database for a 48-hour event queried wholly inside its second day:

  • bounded event GET and count;
  • actual CSV body row;
  • AQL sum_durations(query_bucket(...)) and query_bucket_eventcount(...).

The tests preserve existing clipped Peewee behavior (one-hour interior result), not full-duration AQL semantics. Reads must not alter the stored 48-hour event. make test explicitly runs the new file, so it cannot silently miss CI.

Verification

  • Against fetched core master c7821899 and server master 994ea98: all four regressions fail with missing rows/zero counts.
  • With core repair 0bd7f67 on PYTHONPATH: 4 passed.
  • Owning make test with repaired core: 148 passed; make typecheck: 32 files clean.
  • Explicit local server test files excluding network-dependent test_client.py: 231 passed with repaired core.
  • Black check and hook-enabled commit clean. No real listener/history touched.

Deliberate merge gate

Draft until an aw-core dependency containing ActivityWatch/aw-core#197 is available and adopted. The locked aw-core 0.5.18 still has the defect, so these tests are expected RED with the unmodified lock. Do not merge a test suite that requires an unshipped dependency. No server production-code change or temporary version skip is proposed; the required follow-through is update the dependency/lock after a containing core release, replay this suite, then mark ready.

Git-Session-Id: d8a22e8f-4386-4789-bab9-5ddd743d4b08
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The changes affect the server's test coverage, not its runtime behavior.

The review found one non-blocking test gap: CSV and AQL should also check that reads leave the saved event unchanged.

Findings

  1. P2 Saved-event changes go unchecked ▶

Summary

Adds four Flask HTTP regressions for a 48-hour event queried inside its second day.

  • Long-event overlap checks cover REST, CSV, and AQL reads.

TimeToBuildBob explicitly keeps the PR draft because the locked aw-core lacks the repair. The stated follow-through is to adopt a containing release and rerun the suite before merging.

Reviews (1) · Last reviewed commit: "test(server): guard long-event overlap c..." · Reviewed by Greptile

Comment thread tests/test_long_event_overlap.py Resolved
Git-Session-Id: 4cb0ead5-8800-5d0b-ae25-627bf2fd2fdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant