-
Notifications
You must be signed in to change notification settings - Fork 12
feat: refinements in api generator; initial polytest integration for algod #222
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
Draft
aorumbayev
wants to merge
23
commits into
decoupling
Choose a base branch
from
decoupling-algod-tweaks
base: decoupling
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.
+15,145
−4,123
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
- Only set format=msgpack when msgpack is explicitly selected - Remove unnecessary format=json assignments for JSON-only endpoints - Align with TypeScript client behavior
Generated output from updated client.py.j2 template: - Remove format=json for endpoints that only support JSON - Simplify msgpack format selection logic - Reduce unnecessary query parameters
When dataclasses use slots=True and have fields named 'bytes' or 'type', the class namespace contains member descriptors that interfere with get_type_hints() evaluation. Fix by passing explicit globalns with builtins and empty localns to get_type_hints() to avoid the class namespace pollution. Fixes TypeError: unsupported operand type(s) for |: 'member_descriptor' and 'NoneType'
The local_state_schema and global_state_schema fields may not always be present in wire data from the ledger state delta endpoint. Make them optional with default=None to handle missing fields gracefully.
Add Docker container-based mock server fixtures using testcontainers: - MockServerContainer class to manage PollyJS mock server lifecycle - Session-scoped fixtures for algod, indexer, and kmd mock servers - Mock server replays pre-recorded HAR files for deterministic testing - Fixtures automatically start/stop containers per test session - Configure via POLYTEST_MOCK_SERVER_IMAGE and POLYTEST_RECORDINGS_PATH env vars - Add test configuration constants matching TS mock server config
- Add testcontainers>=4.0.0 to dev dependencies for mock server containers - Add polytest generate/validate tasks for algod, indexer, kmd clients - Update transact polytest config to use algorandfoundation repo - Add polytest-generate-all and polytest-validate-all aggregate tasks - Add group_common_tests pytest marker for polytest test groups
- Install Rust toolchain and polytest CLI - Run polytest-validate-algod to ensure test structure matches polytest config - Validates that generated test files follow the expected naming conventions
Move manually written tests to tests/modules/algod_client/manual/ to distinguish them from polytest-generated test stubs: - test_block.py - test_ledger_state_delta.py - test_pending_transaction_information.py - test_raw_transaction.py - test_simulate_transactions.py - test_suggested_params.py Also fix localnet tests to use AlgorandClient.default_localnet().client.algod consistently instead of mixing mock server with localnet transactions.
Add NOT IMPLEMENTED test stubs for algod client API endpoints: - DELETE endpoints (catchup, ledger_sync) - GET endpoints (boxes, state proofs, deltas, devmode, experimental, etc.) - POST endpoints (catchup, ledger_sync, shutdown, teal, transactions) All stubs are marked with @pytest.mark.skip(reason='Test not implemented') and follow the polytest naming convention matching TypeScript tests. These stubs serve as placeholders for future test implementation and ensure structural parity with algokit-utils-ts polytest suite.
- Implement test_get_genesis.py, test_get_health.py, test_get_versions.py - Implement test_get_v2_status.py, test_get_v2_ledger_supply.py - Implement test_get_v2_transactions_params.py - Implement test_get_v2_accounts_address.py with localnet - Implement test_get_v2_blocks_round.py with mainnet/testnet endpoints - Implement test_get_v2_deltas_round.py with mainnet endpoint - Skip msgpack-related tests matching TypeScript approach - All tests verify client methods return correct model types
- Move indexer and kmd integration tests to manual/ folders - These tests require localnet with indexer/kmd, not mock server - Update tests to use localnet clients directly - Add E501, W292, I001 lint ignores for tests/modules/**/* in pyproject.toml - Fix trailing newlines in polytest stub files (pre-commit format)
…duplicate schemas removed
…lelock dependency
…ced by filtered oas tags are not generated
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.
WIP draft, remaining polytest tests are still being implemented
Notes