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.

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] No new issues were found; the stated dependency merge gate should remain in place.

Summary

Adds four HTTP regression cases for a 48-hour event queried inside its second day.

  • Long-event checks run with the server's regular tests.

Reviews (2) · Last reviewed commit: "test(server): verify long-event reads pr..." · Reviewed by Greptile

Comment thread tests/test_long_event_overlap.py Resolved
@TimeToBuildBob
TimeToBuildBob force-pushed the test/long-event-overlap branch from e5cae17 to 61c0430 Compare November 6, 2026 15:41
@TimeToBuildBob

This comment has been minimized.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Rebased onto current master f2aec9707b63aeb4c6f8dd40430bf5a992a4ea4e (includes the Ubuntu 24.04 pin in 5e0ae8f). Removed the redundant runner hunk from the mixed preservation-test commit; all test and Makefile changes are byte-for-byte unchanged from the previous head. New head: 61c0430ac5c17ab2e9a2a66d78b83a673613aef0.

There is now no .github diff against master. Both Linux jobs inherit Ubuntu 24.04 and master’s action versions. Local Python 3.13 verification: the four overlap regressions still fail with aw-core 0.5.18, reproducing the documented dependency gate; with repaired core 0bd7f67 supplied on PYTHONPATH, full existing make test passes 148 tests, including all four regressions. No dependency/lock change or test skip was added. This PR stays draft pending adoption of a containing core release.

Force-with-lease push completed with hooks enabled; the Greptile helper accepted one fresh review request for this exact head. Latest-head CI/review is pending; no merge performed.

Git-Session-Id: d8a22e8f-4386-4789-bab9-5ddd743d4b08
Git-Session-Id: 4cb0ead5-8800-5d0b-ae25-627bf2fd2fdf
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Converted to draft: this test-only guard cannot go green until its dependency lands.

Blocker chain: ActivityWatch/aw-core#194 (Peewee range queries omit accepted events longer than 24h) → fixed by ActivityWatch/aw-core#197 (all checks green, awaiting merge) → release → aw-server bumps aw-core past ^0.5.18. Until then the bounded REST/count/CSV/AQL assertions correctly fail here, because the installed aw-core still has the 24h prefilter bug.

Not rebasing while parked. Rebase and undraft once aw-server's aw-core pin contains the fix.

@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

Parking as draft: the red CI here is the expected signal of a missing dependency, not a defect in this PR.

The test file's own docstring says it requires an aw-core containing the repair for ActivityWatch/aw-core#194 (Peewee range queries omit accepted events longer than 24 hours). That repair is ActivityWatch/aw-core#197, which is green on its current head but not merged, and master here pins aw-core = "^0.5.18".

So test_bounded_* fail on all three platforms by construction: bounded GET/CSV/AQL return 0 events because the prefilter drops the row upstream. Nothing in this repo can make them pass.

Leaving it open as a draft so the guard is ready. Undraft only after aw-core#197 is released and the pin here moves past it; do not rebase before then.

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