libtest-mimic icon indicating copy to clipboard operation
libtest-mimic copied to clipboard

Add --fail-first flag

Open markusa380 opened this issue 1 year ago • 2 comments

markusa380 avatar Jun 11 '24 16:06 markusa380

Hey and thanks for the PR! If I'm not mistaken, --fail-first is not a flag in the built-in libtest right? So this would be an additional feature of libtest-mimic, right? Generally I try to avoid those, as then there is no end to what useful features one could add to this library. Do you have a special reason to add this? What's your use case?

LukasKalbertodt avatar Jun 28 '24 08:06 LukasKalbertodt

I understand your point, yes. We are using this feature in our company's project, as we use libtest-mimic to run a large test suite for our query engine. We want this test suite to stop running on the first error in CI to save considerable time and resources.

markusa380 avatar Jun 28 '24 08:06 markusa380

I have to reject this feature request at this time. As I said: this crate aims to be a direct replacement for the built-in test harness, with basically no additional features. Otherwise, the scope could explode, as there are always interesting features one can add.

As for your use case: you can fairly easily implement a fail-first approach on top of this crate. You pass runner functions to libtest_mimic::run, so you can simply have some boolean flag failed and check that before actually running the test. It's not as nice as if it was built in, but it's still doable.

LukasKalbertodt avatar Oct 05 '24 11:10 LukasKalbertodt