weaver-test icon indicating copy to clipboard operation
weaver-test copied to clipboard

ForEachTest resource

Open amumurst opened this issue 3 years ago • 3 comments

Add IOForEachSuite as a way to acquire a new instance of a resource for each test in a suite.

Combining this with global makes it possible to do things that I have not seen in other test frameworks, for instance having the global scope setting up a Database provider and shutting it safely down after all tests are done, but still allowing tests to be written across multiple files, without dependencies on each other and with every test getting a fresh database.

I have tried to implement and test this pattern in UniqueResourceSuite and SharedResourceSuite.

If this is something you want to move forward with I would be happy to look at adding it to the docs.

amumurst avatar Jul 07 '21 15:07 amumurst

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 07 '21 15:07 CLAassistant

@amumurst hi, and thanks for the contribution ! This feature had been requested by several people and was on my backlog, so the PR makes me happy.

I'm gonna take some time (probably tomorrow) to give it a proper read and reflect about the implications of your implementation, but at the very least I can tell you that there is interest 😄

Baccata avatar Jul 07 '21 16:07 Baccata

Any plans to bring this feature to the project?

vladimir-popov avatar May 20 '22 03:05 vladimir-popov