Skip to content

test: check time[gt] and time[lt] filters on the event list API - #1265

Open
Trenyx wants to merge 1 commit into
hookdeck:mainfrom
Trenyx:test/event-time-gt-lt-filter
Open

Trenyx wants to merge 1 commit into
hookdeck:mainfrom
Trenyx:test/event-time-gt-lt-filter

Conversation

@Trenyx

@Trenyx Trenyx commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1264, as discussed there. If listEventsInternal ever passed time[gt] through as LT and time[lt] as GT when it builds the log store query, GET /api/v1/events?time[gt]=... would return the events before the cutoff instead of after it, and a time[gt] + time[lt] range would come back empty. No test would notice: the existing filtering cases cover time[gte] and time[lte] only.

Tests only: two subtests (+32 lines) next to "time gte filter" and "time lte filter" in TestAPI_Events (internal/apirouter/log_handlers_test.go), same setup and cutoff. time[gt] must return the two events after the cutoff (not e1), and time[lt] only e1. No change to library code.

How it was checked

On main af13e96:

  • go test -short -count=1 ./internal/apirouter/: ok. gofmt and go vet are clean.
  • With GT: eventTimeFilter.LT and LT: eventTimeFilter.GT in listEventsInternal, both new subtests fail and nothing else in the package does. Without these tests, go test -short ./... shows no failure with that swap in place.

This test was written with Claude Code during a planted-bug run by SK @ Trenyx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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