Reorganize tests into domain-grouped subdirectories#24
Open
plind-dm wants to merge 3 commits intoentrius:testfrom
Open
Reorganize tests into domain-grouped subdirectories#24plind-dm wants to merge 3 commits intoentrius:testfrom
plind-dm wants to merge 3 commits intoentrius:testfrom
Conversation
Restructure the flat tests/ layout into subdirectories that mirror the source tree (core/, contract/, chain_providers/, validator/, miner/). Split the mixed test_scale.py into contract/test_scale.py and chain_providers/test_subtensor.py. Extract shared swap and transaction fixtures into tests/helpers.py to eliminate duplication across modules. Add pytest-cov with term-missing and HTML report targets.
Author
|
Hey @LandynDev @anderdc , could you take a look at this when you get a chance? No functional changes — purely test infrastructure. The main things to verify are that the subdirectory layout makes sense to you and that the helpers.py factory pattern is the right abstraction for shared fixtures. Happy to adjust the structure if you prefer something different. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add unit tests for previously uncovered modules: - SwapPoller incremental scan, cursor management, mark_processed - SwapTracker initialize, poll, prune_window, query helpers, _resolved_block - apply_recycle: emission vs fee scaling, recycle_uid accumulation, edge cases - commitments: decode_commitment_field, get_commitment, read_miner_commitment, read_miner_commitments - create_chain_providers: registry forwarding, check/require_send flags, failure handling - utils.misc: ttl_cache, _ttl_hash_gen, ttl_get_block - utils.logging: setup_events_logger, log_on_change dedup behaviour Extend existing suites for previously missed branches in fulfillment (non-TAO dest commitment lookup, save exception path) and pending_confirms (remove-nonexistent, closed-connection guard). Coverage: 43% → 55% (389 tests, +109 tests)
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
tests/layout into subdirectories mirroring the source tree (core/,contract/,chain_providers/,validator/,miner/)test_scale.pyintocontract/test_scale.pyandchain_providers/test_subtensor.pyby concernmake_swap/make_confirmed_txfactories intotests/helpers.py, eliminating duplication across modulespytest-covwithterm-missingand HTML report targets; coverage baseline is 43%Test plan
uv run pytest— all 280 tests pass