test(signals): Expand Activity Signals Test Coverage and Time-Range Query Support - #28
Merged
Adilislam0 merged 7 commits intoJun 20, 2026
Conversation
yayyyyshi
force-pushed
the
yashika/activity-signals-tests
branch
from
June 20, 2026 15:27
e6c5904 to
e2d2ee9
Compare
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
This PR expands the automated integration test coverage for the Activity Signals module and enhances the querying API with timestamp range filtering.
The changes improve validation, authentication testing, filtering behaviour, pagination coverage, logging verification through mocking, and timestamp-based querying, providing stronger confidence in the Activity Signals API before Phase 4 Recommendation Engine integration.
What Changed — File by File
tests/test_activity_signals.pyExpanded the Activity Signals integration test suite.
Signal Ingestion Tests
Added coverage for:
sourcepreservationsource="api"behaviour401)streamevent_typeQuery Endpoint Tests
Added coverage for:
404limitLogging Tests
Added mock-based tests verifying:
log_user_activity()is called during signal ingestion.These tests improve confidence around both the normal execution path and failure scenarios without requiring changes to the production logging implementation.
src/lpi/routers/signals.pyExtended the Activity Signals query endpoint.
Added
New optional query parameters:
startendThese allow clients to retrieve signals within a specified timestamp range.
Example:
Updated
startandendfilters to the store layer.src/lpi/store.pyExtended the Supabase-backed query layer.
Added
Support for timestamp range filtering using Postgres comparison operators:
.gte("timestamp", start.isoformat()).lte("timestamp", end.isoformat())The store now supports filtering by:
All filtering continues to execute server-side in Supabase/Postgres.
Test Coverage
The Activity Signals module is now covered for:
limit)Notes for Reviewers
startandend) is implemented end-to-end from the API layer through the Supabase query builder.log_user_activity()has no observable external side effects.How to Test
Example timestamp filtering:
Example pagination:
Impact
This PR strengthens the Activity Signals module by:
Phase
Module: Activity Signals
Phase: 3
Owner
Yashika Verma