test-check

kenny 2020-04-11T16:48:57.008500Z

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.

2020-04-11T16:51:05.009600Z

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

kenny 2020-04-11T17:22:37.010Z

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

kenny 2020-04-11T17:23:19.011Z

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

2020-04-11T17:23:23.011200Z

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

kenny 2020-04-11T17:24:12.012Z

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

2020-04-11T17:25:23.013500Z

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

kenny 2020-04-11T17:25:31.013700Z

Right

kenny 2020-04-11T17:26:03.014100Z

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

kenny 2020-04-11T17:26:50.014800Z

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

2020-04-11T17:27:43.015500Z

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

kenny 2020-04-11T17:28:15.016600Z

Yes - it may or may not.

2020-04-11T17:28:53.018100Z

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

2020-04-11T17:29:18.018700Z

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

kenny 2020-04-11T17:30:13.019200Z

For sure. Distinct can be impossible to define too 🙂

2020-04-11T17:30:34.019700Z

Yep that's part of it

2020-04-11T17:32:53.022500Z

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

2020-04-11T17:33:06.023Z

gen/scale

2020-04-11T17:33:57.024100Z

With min

kenny 2020-04-11T17:34:18.024200Z

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.

kenny 2020-04-11T17:35:26.025400Z

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.

2020-04-11T17:36:08.025600Z

Sure

kenny 2020-04-11T17:36:33.025800Z

Thanks 🙂

1👍