-
Notifications
You must be signed in to change notification settings - Fork 4
feat(test-infra): add Thrift verification to OpenAPI spec #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eric-wang-1990
wants to merge
6
commits into
main
Choose a base branch
from
stack/e.wang/peco-2865-verification-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
ed91b65 to
292fcf6
Compare
292fcf6 to
3c9f5b3
Compare
d201da8 to
08e2efe
Compare
Adds capability to track Thrift method calls through the proxy and verify expected call sequences in tests. Features: - Automatic call tracking: Records method name, timestamp, message_type, sequence_id - Auto-reset: Call history resets when a scenario is enabled (per test) - Limited history: Max 1000 calls to prevent memory issues - Verification API: Supports exact_sequence, contains_sequence, method_count, method_exists API Endpoints: - GET /thrift/calls - List call history - POST /thrift/calls/reset - Manual reset - POST /thrift/calls/verify - Verify expected sequences This enables tests to verify: - CloudFetch fallback behavior (expired link → FetchResults → retry) - Correct API call sequences - Method invocation counts Tested with test_call_tracking.py - all tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Updates OpenAPI spec with Thrift call tracking endpoints and regenerates C# client. This enables all languages to use auto-generated clients. Changes: - Added 3 new endpoints to openapi.yaml: * GET /thrift/calls - Get call history * POST /thrift/calls/reset - Reset history * POST /thrift/calls/verify - Verify sequences - Added 3 schemas: * ThriftCallHistory - Call history response * ThriftVerificationRequest - Verification request * ThriftVerificationResult - Verification response - Regenerated C# client with new methods: * GetThriftCallsAsync() * ResetThriftCallsAsync() * VerifyThriftCallsAsync() - Updated ProxyControlClient with wrapper methods This enables language-agnostic test implementations. Java, Python, C++, Go can all generate clients from the same OpenAPI spec. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Implements comprehensive tests for Thrift protocol session and statement operations using the new call verification API. Session Lifecycle Tests (5 tests): - BasicSession_OpensAndCloses - Verifies OpenSession → CloseSession - Session_ExecutesQuery_WithProperSequence - Full query sequence - Session_WithMultipleStatements_TracksAllOperations - Multiple statements per session - Session_CloseOperationCalled_AfterEachStatement - Resource cleanup verification - Session lifecycle management Statement Execution Tests (6 tests): - SimpleQuery_ExecutesWithExpectedSequence - Basic ExecuteStatement flow - LongRunningQuery_PollsOperationStatus - GetOperationStatus polling - StatementWithFetchResults_CallsExpectedMethods - FetchResults verification - MultipleStatements_EachHasOwnOperation - Concurrent statement handling - Statement_OperationLifecycle_ProperSequence - Verify call ordering Key Features: - Uses VerifyThriftCallsAsync for sequence validation - Tests method counts, existence, and ordering - Validates proper resource cleanup (CloseOperation) - Covers both fast (directResult) and slow (polling) queries Based on PR #74 design doc test categories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
…ification tests - Fixed ValueTask.Wait() errors by using .AsTask().Wait() - Fixed bool? comparison by using == true - Implemented TypeEnum conversion for ThriftVerificationRequest - Registered custom JSON converters (ThriftVerificationRequest, ThriftVerificationResult, ThriftCallHistory) - Fixed optional parameter handling to only set non-null values - Commented out BadRequest deserialization (TODO: fix in future) - Added Task.Delay() before verification to allow async disposal Tests now compile and run with 2/4 SessionLifecycleTests passing. Remaining failures reveal that CloseOperation calls may not be tracked properly by the driver, requiring further investigation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
…logic - Updated tests to handle both fast path (DirectResults) and slow path - Added conditional CloseOperation checks: only required when GetOperationStatus is called - Fixed connection disposal timing to ensure CloseSession is tracked - Added ThriftCallHistoryCallsInnerJsonConverter for proper deserialization - Removed SET use_cached_result commands (DirectResults optimization handles this) - Restructured Session_ExecutesQuery_WithProperSequence to dispose connection before verification All SessionLifecycleTests now passing (4/4): - BasicSession_OpensAndCloses ✅ - Session_ExecutesQuery_WithProperSequence ✅ - Session_WithMultipleStatements_TracksAllOperations ✅ - Session_CloseOperationCalled_AfterEachStatement ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
08e2efe to
308202c
Compare
- Fix typo 'REAMDE' -> 'README' - Add missing newlines at end of files - Remove trailing whitespace 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
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.
🥞 Stacked PR
Use this link to review incremental changes.
What's Changed
Please fill in a description of the changes here.
This contains breaking changes.
Closes #NNN.