This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-23
Channels
- # announcements (8)
- # babashka (12)
- # babashka-sci-dev (6)
- # beginners (62)
- # biff (5)
- # calva (4)
- # cider (2)
- # clj-commons (8)
- # clj-kondo (17)
- # clj-yaml (40)
- # clojars (3)
- # clojure (117)
- # clojure-europe (122)
- # clojure-nl (5)
- # clojure-norway (20)
- # clojurescript (10)
- # consulting (1)
- # datomic (65)
- # events (15)
- # figwheel (1)
- # fulcro (4)
- # lsp (15)
- # mount (15)
- # music (1)
- # off-topic (53)
- # polylith (12)
- # releases (3)
- # shadow-cljs (13)
- # sql (1)
- # test-check (8)
- # xtdb (31)
Does anyone know a simple way to have test.check change one parameter more slowly than another? So for example, parameter B changes every test whilst parameter A changes only every 10 tests.
I don't know of any way to finely control generation per-test, but you could look at frequency
Yeah, frequency isn't really what I'm after here. What I'd really like yo do is to spin up a system with generated config and then fire a request against the system. But the system is expensive to spin up, and I'm happy with a small number of instances of it. So I want to bootstrap a single system, fire multiple samplings of the other params against it then move on to another generated system.
In that case I would write a test where your generator generators a collection that you can apply in loop over a single bootstrapped instance. I would make sure that you wrote it so it short circuits on the first failure. Shrinking might take a bit longer, but test check does a good job shrinking collections so you'll most likely end up just a vector of a single item.
There's also a trick to writing a collection generator that targets a certain size but shrinks to zero, I'll see if I can find it
Ah, i see. I was worried this approach wouldn't point me at the exact failure scenario. But you're saying I could achieve that by having the collection of failing tests shrink to the failing one. Smart idea, I'll give it a go!!