test: add unit tests for Response Store filter and config#236
Open
leseb wants to merge 3 commits into
Open
Conversation
|
Missing Signed-off-by: 308ec5c. All commits require sign-off (via |
|
PR too large: 972 lines added (limit: 750, excludes Cargo files, tests, docs, examples, and benchmarks). Please split into smaller PRs. Add |
Add 47 new tests covering previously untested code paths in the Response Store module: - Direct list_input_items unit tests (16 tests): scalar/null/empty input wrapping, ascending/descending order, limit clamping (0→1, >MAX→MAX), ID-based and numeric cursor pagination, next_cursor computation with and without item IDs - Filter lifecycle edge cases (10 tests): on_request_body non-EOS and non-POST paths, message assembly with null/missing output, non-array output, object/null/missing input, custom tenant_id persistence - GET input_items edge cases (5 tests): trailing slash handling, scalar input wrapping, default descending order, empty input, tenant isolation - Config validation edge cases (16 tests): sqlite memory URL variants, revalidate_postgres_host direct tests, IPv6 unique-local/ unspecified/link-local SSRF rejection, IPv4-mapped loopback in authority, hostaddr with invalid IP, URL fragment vs query separation, ssl-cert/ssl-key/ssl-ca alias path traversal Closes praxis-proxy#230 Signed-off-by: Sébastien Han <seb@redhat.com>
308ec5c to
5af8ca9
Compare
1 task
String input is now returned as a user message item matching the OpenAI ItemResource schema, and null input yields an empty list instead of [null]. This aligns list_input_items with the existing append_stored_input_items normalization used for message assembly. Signed-off-by: Sébastien Han <seb@redhat.com>
d57f20d to
a2515e6
Compare
Update input_items_from_string_input to expect a message item instead of a raw string, matching the normalize_input_items fix. Signed-off-by: Sébastien Han <seb@redhat.com>
a2515e6 to
8eb5d7d
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
filter.rs,config.rs,input_items.rs)list_input_itemsunit tests for pagination edge cases (scalar/null/empty input, limit clamping, cursor logic, ordering)Closes #230
Test plan
cargo test -p praxis-ai-apis --lib openai::responses::store::tests)cargo clippy -p praxis-ai-apis --tests)