CTest RESOURCE_GROUP that applies to multiple tests in a sequence

34 views Asked by At

I have a test that requires a deamonized fixture. This fixture consumes a resource with name "port" (the resource spec file contains 16 ports, starting with 5432, for my non-persisted postgres docker containers).

Since the fixture is a deamon, the test will return immediately and (I suppose) release the resource - but I need it to still be reserved for my daemon during the actual test! What can I do?

What I tried: Originally, I had the RESOURCE_GROUPS (along with some other environment variables) added to the actual test. This did not pass the required environment variables to my fixture setup test, so the overall test failed (the fixture depends on the environment variables).

Now I moved the test properties to the fixture setup, so my test actually works - but only because I have no other tests running concurrently (I suppose).

1

There are 1 answers

0
MKasperczyk On BEST ANSWER

I ended up putting both fixture setup/teardown and the actual test into a script and it works fine.