Ahmed-Ali/Cucumberish

How to execute tests in parallel?

olyv opened this issue · 4 comments

olyv commented

Hi,
There is an option to run test in parallel in Xcode 10 ("Execute in parallel on simulator" ). That option works fine with XCTest only but I am not sure how to do it with Cucumberish. In other words, how to split Cucumberish.executeFeatures between several classes inheriting XCTestCase. I asked the same question on Stackoverflow but it doesn't seem to receive a lot of attention :) Has anyone managed to parallelize Cucumberish tests?

You need to edit your scheme. Under test -> info for each test target there should be an options button. Clicking that will show the checkbox for test parallelization. Xcode will distribute the tests by feature file to each simulator instance. The WWDC video contesting from 2018 has more details.

olyv commented

yeah, I could solve my problem by subclassing CucumberishInitializer but Xcode test parallelization works in unpredictable way and I could have up to 2 -3 simulators at a time. After all, I had to create my own sharder and refused using Cucmberish in favour of different Cucumber-like swift library

Part of the point of parallelization is randomness and unpredictability. That is good in testing. And it would only do randomness on the feature file basis, not a scenario basis. But if you're all set, then that's good.

can u share your problem solving @olyv ? i still looking at doing parallelization in cucumberish 🙇 . thank you