hiero-ledger / hiero-ledger/hiero-consensus-node
PCLI: Add support for cleaning environment
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
### Problem
In order to support certain full stack, end to end, and integration test scenarios, the physical node servers need to be cleaned/cleared of data from the prior execution of the node software before the next test can be executed.
A PCLI tool which knows how to cleanup both platform and services files generated during the execution of the node software is an ideal solution which allows the test framework to clean up these files/resources without needing to be tightly coupled to the platform/node software implementations.
This also keeps the cleanup code close to the code which generates the files/resource such that any changes to one can be easily reflected in the other and both are under the control of the same owners/authors.
### Solution
Add a PCLI command which is capable of cleaning up the logs, metrics, states on disk, and other files/resources generated during the execution of the node software.
Such items include but is not limited to the following:
- Logs
- Metrics/Stats CSV files
- Saved States
- Temporary files/directories
- Recovery files
- Software upgrade files/folders
- Record/Sidecar/Event/PCES streams
### Alternatives
- Making the test framework aware of the files/folders/resources generated during the node software execution.
- This is undesirable since this creates a very brittle test framework where the code doing the cleanup is disconnected from the code generating the files/folders/resources.
- It is also undesirable because it now results in multiple teams maintaining two different pieces of code and creates a undue burden on the teams to communicate each and every change.
- Failures would be guaranteed to only manifest during test execution and could be obscure in nature.
Contributor guide
Research direction
The issue names no files, tests, or PCLI entry point. Start by locating the PCLI command structure and the code responsible for generating the listed logs, metrics, states, temporary files, recovery files, upgrade files, and streams. Done means a PCLI command can clean these resources so full-stack, end-to-end, and integration tests can reset physical nodes between executions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cli, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100