vaadin / observability-kit

Other
5 stars 3 forks source link

Configure MockServer to allow parallel execution of integration tests #193

Open mcollovati opened 1 year ago

mcollovati commented 1 year ago

Currently, every integration test that collects traces starts an instance of MockServer and some of them fails because the server port is already bound.

To allow parallel execution, we should start the server only once per test suite, either by setting @MockServerExtension.perTestSuite=true on every test or by configuring the MockServer maven plugin. In addition, we also need to make sure that tests only assert on traces produces by their own interaction, for example by filtering spans by vaadin.sessionId or vaadin.frontend.id attributes.

Note: the example MockServer maven plugin configuration binds the start goal to the process-test-classes, probably because it wants to use it also for unit tests. We can instead use the pre-intergration-test phase.