testing

Testing tools, testing philosophy & methodology...
NoahTheDuke 2021-03-30T13:26:37.002400Z

is it possible to exit a single test early? I want to be able to say (deftest sample (is-2 (= 1 2) "Stop here please") (is (= 1 2) "Never checked")) and have the second is not ran because it early exits but while still running all of the other deftest s

plexus 2021-04-04T07:08:52.003900Z

Kaocha implements fail-fast at the "is" level, we throw/catch a custom exception to break out of the current deftest.

NoahTheDuke 2021-04-04T11:00:41.004400Z

That’s cool! I’ll check out Kaocha

vemv 2021-03-30T17:47:53.002700Z

as a cheap trick you could wrap each is in an assert Without a helper like that, you'd have to hack the clojure.test multimethods. https://github.com/circleci/circleci.test/ implements fail-fast (at deftest level; not at is level) so you can take some inspiration from there

NoahTheDuke 2021-03-30T18:42:20.002900Z

I can't find anything about fail-fast in circleci.test. have a line number for me to look at?

vemv 2021-03-30T18:44:14.003100Z

slightly misremembered :) it's not implemented there, but I hacked locally and also reflected my technique here https://github.com/circleci/circleci.test/issues/39

👍 1
NoahTheDuke 2021-03-30T18:45:56.003500Z

oh i see, this is about aborting all future deftests if a given one fails. yeaeh that would be helpful but is different than i'm looking for. i'll pursue modifying/writing a wrapper for deftest. thank you!