#How do I run some effectful code before tests are run?

4 messages · Page 1 of 1 (latest)

rocky lynx
#

The title pretty much says it all. I need to start a binary and set up a docker container before my tests are run.

I am actually using tokio::test but I am curious about what the general solution to this problem is as well.

dull sequoia
#

Put all your stuff in one test?

#

Generally, this kind of situation is hard to manage because it’s best avoided in the first place (i.e. prefer I/O-less solutions where you can do purely in-memory, cheap to set up and cheap to tear down tests)

#

So ideally the solution would be “redesign your code so you don’t need to do this”