Open tanya-borisova opened 1 year ago
One option would be to move to NOSE framework for our e2e tests: https://nose.readthedocs.io/en/latest/plugins/multiprocess.html
Or there is a documented file-based approach of doing this with pytest (although it is a little hacky perhaps): https://pytest-xdist.readthedocs.io/en/latest/how-to.html#making-session-scoped-fixtures-execute-only-once
NOSE isn't maintained anymore and it's not clear if nose2 has the capability we need for shared fixtures.
@tamirkamara the approach I went for is what pytest describe in their documentation: https://pytest-xdist.readthedocs.io/en/latest/how-to.html#making-session-scoped-fixtures-execute-only-once
So you did it already @tanya-borisova? Where? Does it handle the tear down well?
I had a branch with this work that never made it to PR stage, it was only half-done. I didn't get to implementing tear down
In https://github.com/microsoft/AzureTRE/issues/2839 , I created session fixtures to create a set of workspaces for testing, Unfortunately, they don't work with
pytest-xdist
which I used to parallelise tests in https://github.com/microsoft/AzureTRE/issues/2840 (they still work but not as session-scoped, and get executed once per testing thread).Find a different way to pre-create test workspaces, or a workaround for session scope fixtures for pytest, or abandon the idea of re-using test workspaces.