Skip to content

refactor: reorganize tests into domain-grouped subdirectories#70

Closed
nightmare0329 wants to merge 1 commit intoentrius:testfrom
nightmare0329:fix/reorganize-tests-domain-subdirs
Closed

refactor: reorganize tests into domain-grouped subdirectories#70
nightmare0329 wants to merge 1 commit intoentrius:testfrom
nightmare0329:fix/reorganize-tests-domain-subdirs

Conversation

@nightmare0329
Copy link
Copy Markdown
Contributor

Summary

Restructures the flat tests/ layout into subdirectories mirroring the source tree, making it easier to locate tests for a given module.

New layout:

tests/
├── helpers.py                    — shared factories
├── core/                         — SCALE codec, chain registry, commitments, rate math
├── chain_providers/              — Bitcoin signing and address validation
├── validator/                    — axon handlers, event watcher, scoring, state store, poll commitments, swap tracker
└── miner/                        — swap fulfillment

Shared helpers extracted into tests/helpers.py:

  • make_swap: unified Swap factory previously duplicated across test_swap_tracker.py and test_fulfillment.py
  • METADATA_PATH: shared path constant previously duplicated in test_scoring_v1.py and test_event_watcher.py

Related Issues

Closes #24

Type of Change

  • Refactor

Testing

  • All 291 previously-passing tests continue to pass
  • The 9 pre-existing failures in test_axon_handlers.py are unchanged

Checklist

  • Code follows existing style conventions
  • Self-reviewed the diff
  • No documentation changes required

Restructures the flat tests/ layout into subdirectories mirroring the
source tree, making it easier to locate tests for a given module:

  tests/core/            — SCALE codec, chain registry, commitments, rate math
  tests/chain_providers/ — Bitcoin signing and address validation
  tests/validator/       — axon handlers, event watcher, scoring, state store,
                           poll commitments, swap tracker
  tests/miner/           — swap fulfillment

Extracts shared factories into tests/helpers.py to eliminate duplication:
  - make_swap: unified Swap factory previously copied across
    test_swap_tracker.py and test_fulfillment.py
  - METADATA_PATH: shared path constant previously duplicated in
    test_scoring_v1.py and test_event_watcher.py

All 291 passing tests continue to pass. The 9 pre-existing failures in
test_axon_handlers.py are unchanged.

Closes entrius#24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant