Fork me on GitHub
#test-check
<
2020-04-11
>
kenny16:04:57

Is there a way to get test-check to continue running a check even if one fails? I'm looking to create a large list of failure values for further analysis. Going to try using with-redefs on results/pass? . Curious if anyone else has done something like this.

gfredericks16:04:05

Are you using defspec in particular? Do you want shrunk values or just original failures?

kenny17:04:37

@gfredericks Just quick-check on a prop/for-all.

kenny17:04:19

In this case, I don't really care all that much on shrunk vs original.

gfredericks17:04:23

Wouldn't it be pretty easy to run it in a loop then?

kenny17:04:12

Loop over quick-check N times, collecting failures? Would that cover a good amount of surface area if the iterations to failure is small?

gfredericks17:04:23

You're worried about there being some small likely failure that keeps getting found and obscuring other larger failures?

kenny17:04:03

I think it's likely to fail in < 5 tests.

kenny17:04:50

I'm looking to find holes in my specs, verifying that the hole is correct or the spec is wrong.

gfredericks17:04:43

So the tc failure doesn't represent an actual bug?

kenny17:04:15

Yes - it may or may not.

gfredericks17:04:53

Getting a PBT library to generate distinct failures without iteratively fixing the earlier ones is pretty hard/advanced

gfredericks17:04:18

Any small failure is likely to be a component of larger failures

kenny17:04:13

For sure. Distinct can be impossible to define too 🙂

gfredericks17:04:34

Yep that's part of it

gfredericks17:04:53

You can get it to start at larger sizes if you think that will help

kenny17:04:18

To be more specific about my problem... We have a wrapper around some data pulled from an external API. We query data out using flat maps. Sometimes your query may have no results. This is the "problem". The solution is either: 1) Our generator for the query generated a map that should never be possible. We need to fix the generator (this can be hard) or acknowledge that this case will return no results 2) The external API is missing data for a particular query that should be there. We need to open a support case with the 3rd party, asking them why this is the case and what should be done.

kenny17:04:26

Hmm, that's interesting. I'll try your loop approach first and see what results it brings. If it seems to be missing some cases I can try scaling the gen. Perhaps even using a random scale with each loop.

kenny17:04:33

Thanks 🙂

👍 4