I have a set of tests that take a long time to execute in total. I'd like to shorten some of my test runs by changing all data providers to return only one set of parameters.
I've read through the TestNG documentation and javadoc, but there doesn't appear to be anything like an IDataProviderListener. IMethodInterceptor might work for tests that don't have dependencies set, but that would be an incomplete solution.
I'm also aware that there may be other ways to reduce test time, but I have limited options as my test fixture is physical, slow, and expensive (so parallelization is not available.)
As a concrete example, lets say I have 3 tests: TestA, TestB, TestC, and Test B and C use unique dataproviders. TestB's dataprovider normally returns 5 sets of parameters resulting in 10 executions of TestB. Similar for TestC, but it's dataprovider normally returns 1 parameter set resulting in a single run of TestC. The normal execution would be:
- TestA
- TestB
- TestB
- TestB
- TestB
- TestB
- TestC
What I want is a way to get the following without modifying the dataprovider or test code source:
- TestA
- TestB
- TestC