-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Is your feature request related to a problem? Please describe.
While working on the mirage-boot feature set, it was observed that the current test suite in the node-cli repository is not well-organized and lacks sufficient coverage, particularly for lower-level modules.
Key areas like the operations layer and the docker_utils.py module are either untested or under-tested.
This makes the codebase harder to maintain, refactor, and extend reliably, increasing the risk of regressions.
Specifically:
- The
node_cli/operations/modules lack dedicated tests. - The tests for
node_cli/utils/docker_utils.pyare not comprehensive. - The build script
scripts/generate_info.shlacks automated verification.
Describe the solution you'd like
Refactor the existing test suite structure to improve organization and maintainability.
Implement comprehensive tests for the currently uncovered or under-tested areas, focusing on:
- Operations Layer: Add dedicated tests for modules within
node_cli/operations/(e.g.,base.py,common.py,skale_node.py,volume.py,docker_lvmpy.py) to ensure core setup, update, and management logic is verified. docker_utils.py: Expand tests intests/docker_utils_test.pyto cover functionalities like Docker Compose interactions (compose_up,compose_rm,compose_pull), volume checks (is_volume_exists), container status checks (is_container_running,is_api_running), etc.generate_info.shVerification: Ensure the build-time script correctly generates type information for different builds (Normal, Sync, Mirage).
The refactoring should aim to make the test suite more robust and easier to modify or extend in the future, potentially mirroring the node_cli source structure more closely within the tests directory (e.g., adding tests/operations).
Describe alternatives you've considered
Considered adding tests incrementally without a major refactor.
However, given the current gaps and the goal of long-term maintainability, a more structured approach including refactoring is deemed more beneficial.
Additional context
- The codebase currently has three main logical layers: CLI (
node_cli/cli/), Core (node_cli/core/), and Operations (node_cli/operations/). Strengthening the test foundation for the Core and especially the Operations layers is crucial.