dave08
12/06/2020, 3:06 PMbeforeTest
and afterTest
works... but what's the difference? It sounds from the docs that beforeEach
should be called before each test case with the type Test
, should
isn't a Test
?wasyl
12/06/2020, 4:27 PMisolationMode
to have the behavior you expect?dave08
12/06/2020, 4:29 PMshould
, so that shouldn't really affect this... I'm just having trouble understanding the difference between the various lifecycle stages...wasyl
12/06/2020, 4:35 PMbeforeTest
and afterTest
much really, so I mostly wanted to mention isolation mode in case you didn’t know that the default is somewhat confusing for JUnit users (as each spec is by default only instantiated once? I think)
Anyway we use listeners sparingly and since we’re using isolationMode#perLeaf, we can just rely on before/afterSpec for mostly junit-like behaviordave08
12/06/2020, 4:41 PMIsolationMode.SingleInstance
is the default..., thanks for the remark! I still need listeners for testcontainers though, and it's really puzzling how when a test is run by itself, it works, whereas in the whole suite, that same test fails...wasyl
12/06/2020, 4:52 PMperLeaf
should make the tests mostly independent, unless you’re sharing some statics. Or the listeners aren’t ran as you expect, but I’m not that familiar with them. Perhaps if you post a sample spec with simple listeners with prints and when you’d expect them to run but they don’t, someone will point you towards a solution 🙂dave08
12/07/2020, 1:41 PMperLeaf
until I manage to sort out the repercussions of the other modes...