Tyler-Keith-Thompson / CucumberSwift

A lightweight swift Cucumber implementation
https://tyler-keith-thompson.github.io/CucumberSwift/documentation/cucumberswift/
MIT License
75 stars 19 forks source link

Should parallel execution of tests work? #31

Open esemusa opened 3 years ago

esemusa commented 3 years ago

TLDR: Should parallel execution of tests work (by choosing Xcode parallelization)?

I can provide a minimum working example but I guess it's not needed as this does not seem to be a setup-dependent issue. But here is how to reproduce, trying to achieve test execution:

My observation:

My expectation: If you define two .feature Files and run tests in parallel as stated above, the two .feature files should be executed in parallel

Tyler-Keith-Thompson commented 3 years ago

Short answer, yeah it should work. Can I get more information from you about what version of Xcode, CucumberSwift, and Swift you are using? Unfortunately Apple doesn't provide very good tie-ins to XCTest for this so, like many other libraries, I've got some swizzling happening to try and support parallel test execution and inject the Cucumber tests.

This is a bit of a tricky feature since that's prone to break with new releases, and because it's so darn hard to write a test for.

esemusa commented 3 years ago

Xcode 12.5 Swift: 5.4 CucumberSwift 3.3.4

I downloaded your sample app project https://github.com/Tyler-Keith-Thompson/CucumberSwiftSample and also tried it there. Same result.

Tyler-Keith-Thompson commented 3 years ago

Alright after further investigation parallel test execution is working for unit testing targets, not working for UI testing targets. I suspect there's another method I need to swizzle in order to support it, I'll leave this as an enhancement request.