testing

2023-06-01T09:22:47.648939Z

Hi folks, does anyone have any experiencing in tracking test assertions that run in a spawned thread from the test they are executed in? I’m currently using reactor.test.StepVerifier that allows me to do some custom assertions (via Java Consumer functional interfaces). I can run standard is assertions, however, the results of these assertions do not get tracked by the underlying test - am I just asking for too much or is there potentially another approach? Many thanks in advance!

Drew Verlee 2023-06-20T21:27:02.200299Z

How would you design a system so that you minimized testing to only those things which changed? I know this is a hard problem*TM, what practical steps do you take to try and get 80% of the way there?

2023-06-21T03:28:27.002089Z

@drewverlee honestly I just try to get it to work first, then try to make tests vaguely sane, which depends greatly on the libs/toolkits you are using. I’m using Lacinia/pedestal for the main stack, websockets for graphql subscriptions. In terms of design you can become limit by the stack you use, the choices made, and the tooling available - I’m not even sure minimising is even worth it - how do you know that a change in domain entities won’t affect messages sent out of a websocket to the client? I run my tests all the time to make sure I assume as little as possible - ~200 tests, runs within 5 mins, faster if done in parallel. HTH

mauricio.szabo 2023-06-01T17:31:59.462079Z

You might be asking for too much, but basically - test assertions are tracked via the clojure.test/report multimethod - if you can call this report method, and if you can await for each spawned thread to finish before reporting everything, then you might be able to do it.

Drew Verlee 2023-06-21T14:07:51.406479Z

Thanks rowland, errrr i didn't realize my question got asked inside a thread. I didn't mean to do that.

2023-06-03T05:24:46.131819Z

@mauricio.szabo many thanks for you reply 🙏🏻 sweet I’ll keep hammering this. I think it might actually be working, and there’s simply a test-runner display issue. I forgot to mention I’m using Kaocha, so I’ll take another look at their docs to see what else I might do to improve the test statistics. Thanks again for your suggestions!