bitwizeshift / bitwizeshift/oxtest
Restructure test inputs
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
The current approach to inputs works, but is a little counter-intuitive due to the combinatoric nature of the arguments. This also suffers when combined with subsections, since cohesion may drop if some subtests don't require inputs while others do.
Thus, this provides a different proposal: rather than using `parameters = `, provide an `inputs![ ... ]` macro that expands into an array that _selects_ the correct input at runtime from the current `__Context`.
This could be implemented in the following way:
* `__Context` now stores current input state (no longer just the section path).
* This logic needs to be tied per-section, since sections may now start their own input fields
* Have a `inputs![...]` macro that expands, effectively, into `[...].into_iter().nth(__context.input_index())`
* Have each base-test context iterate through all possible inputs
* Inputs now need to be determined by examining the unit test for each `inputs![...]` macro being used. This is applied per subtest.
This will now require a significant restructure to tests. Having subtests be able to drive parameters means that we no longer have a fixed inputs -> subtests ordering, but rather an arbitrary re-nesting of this.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the current `parameters =` handling, `__Context`, and base-test and subtest execution paths. Trace how inputs and sections are currently ordered, then verify that the proposed `inputs![...]` selection, per-section state, and arbitrary input-to-subtest nesting work across the existing test suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100