-
Notifications
You must be signed in to change notification settings - Fork 0
Add har file recordings for testnet api calls #7
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
Conversation
|
We'll need to update the server to handle this: https://github.com/algorandfoundation/algokit-polytest/blob/feat/multi_client_server/resources/mock-server/src/server.ts#L47-L50 Currently it's only expecting localnet. We'll probably need to have different servers for localnet and testnet. Alternatively we overwrite the URL when recording HAR files The tests will also need to be updated (and we should probably add some CI, but that can be a seperate PR) |
|
I thought we were going to keep this as mock-server as testnet only and configure the client in the native languages test to use localnet. That way we keep the separated. |
|
There may be some things that we want to use localnet for down the road, like maybe some contrived app state, but if we just want to switch to test only for now that's probably the easiest path (and we never need localnet) |
This enables debugging the recording process and captures real testnet API responses for mock server playback. Adds VS Code Bun debugger configuration for server
Reran the har recordings
- Strip transfer-encoding and content-encoding headers in beforeReplay hook to prevent conflicts with content-length and decompression errors - Replace server tests with replay-focused tests - Update unrecorded endpoint test to use non-existent account address - Re-record HAR files with consistent API token format
- Split bin/server.ts (replay-only) and bin/record.ts (recording-only) - Update startServer() to remove mode parameter, always replays - Created tests for replay and recording - Update tests to use new API signatures - Add debug configurations for both tools
61f2919 to
39140fa
Compare
Removed the bin record file since recording happens on every server start
Add TestNet HAR Recording Support
This PR enhances the mock server to record HTTP Archive (HAR) files from live TestNet endpoints, enabling comprehensive API response capture for testing.
Key Changes:
Configured the recording script to capture requests from TestNet API (nodely.dev) instead of localhost. Expanded Algod recording to cover over 20 API endpoints, including status and health endpoints, block/transaction/ledger delta queries, and account/application/asset information. Real testnet data is sourced from utils-py tests and Lora object mothers. There are still some TODOs. Those will get defined through integration.
Also added VS Code/Cursor debugging configuration with Bun extension support and workspace file to improve the developer experience.