Remove dead HistorianStore Protocol, reset query.completed to v1, add HTTP batch/search tests - #43
Merged
Merged
Conversation
… HTTP batch/search tests Issue #25: The HistorianStore Protocol in storage.py was never used as a type annotation — HistorianService and AppContext both use SQLiteHistorianStore directly. The Protocol signatures had also drifted from the concrete class. Removed the Protocol and the unused Protocol import. Issue #31: historian.query.completed was registered at version 2 with no version 1 ever existing in the codebase. Reset the manifest version to 1 and updated schemaversion in _record_query to match. All other builtin schemas already use version 1. Issue #32: Added test coverage for POST /v1/events:batch and POST /v1/search in test_http.py: - Valid batch ingests and returns event IDs with duplicate flags - Malformed batch (missing events array) rejected with 422 - Search filters by SearchSpec fields and returns matching events - Invalid search spec rejected with 422 Closes #25, closes #31, closes #32.
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
Three issues bundled together — all are small, self-contained cleanup items.
Issue #25 — Delete dead HistorianStore Protocol
The
HistorianStoreProtocol instorage.pywas never used as a type annotation anywhere.HistorianServiceandAppContextboth referenceSQLiteHistorianStoredirectly. The Protocol signatures had also drifted from the concrete class (wrongsearch/get_eventparams, missing ~9 methods). Removed the Protocol class and the now-unusedProtocolimport.Issue #31 — Reset historian.query.completed to version 1
historian.query.completedwas registered at version 2 inbuiltin_manifest.jsonwith no version 1 ever existing. All other builtin schemas use version 1. Reset the manifest to"version": 1and updated"schemaversion": 2→"1"inservice.py_record_queryto match.Issue #32 — Add HTTP batch and search endpoint tests
No test coverage existed for
POST /v1/events:batchorPOST /v1/search. Added four tests intests/test_http.py:test_batch_endpoint_ingests_valid_batchPOST /v1/events:batch— response shape, event IDs, duplicate flagstest_batch_endpoint_rejects_missing_events_arrayeventsarray) → 422test_search_endpoint_filters_by_fieldsPOST /v1/searchwithapps/exact_phrases/limit— returns only matching eventstest_search_endpoint_rejects_invalid_specCloses #25, closes #31, closes #32.
Test commands run
All 88 tests pass (4 new); compile check clean.