hiero-ledger / hiero-ledger/hiero-consensus-node
Support per-class lifecycle
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
By default, a `TestEnvironment` has a per-method lifecycle because this is the default behavior of JUnit. This means that a `TestEnvironment` and its included classes are created for each method and destroyed once the method ends.
In some scenarios, we want to reuse the environment (particularly the network) in multiple test methods. We should use the standard JUnit mechanism `@TestInstance(Lifecycle.PER_CLASS)` to enable this.
In addition, we should support the definition of `TestEnvironment` as a field if the lifecycle is per-class.
Contributor guide
Research direction
Start by locating TestEnvironment and the existing JUnit lifecycle handling. Read how environments are currently created and destroyed, then verify the per-class behavior and field-based definition against JUnit's @TestInstance(Lifecycle.PER_CLASS) semantics; done means both requested forms work without breaking per-method behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100