Open jnst opened 9 months ago
@jnst Thank you for your idea.
It's a similar issue to https://github.com/k1LoW/runn/issues/397.
When runn is used as a Go package, BeforeFunc
and AfterFunc
are available.
We are cautious about providing before/after (or fail) in YAML for this issue because it does not offer the same flexibility as Go.
With the current functionality, something similar could be achieved using the force:
section.
In any case, we'll consider it carefully.
Currently, I am utilizing runn with YAML to execute API tests, which includes the creation and cleanup of test data. The specific method of description is as follows:
However, using this method, the data in the table inevitably remains after the test execution. Alternatively, if I move the
clean
step to the end and a test fails midway and is re-run, aduplicate key error
occurs, making management difficult.To alleviate this, I request the addition of a feature that allows the use of hooks commonly used in unit testing, such as
before/after
andbeforeAll/afterAll
.This will likely enable more effective and efficient preparation and cleanup of test data.