Running multiple test targets in parallel

Xcode makes it very easy to run tests inside of a target in parallel, but there appears to be no way to take a scheme that has multiple test targets and run them in parallel. Am I missing something?

Does xcodebuild or some open source tool provide the ability to do this?

Some background to my problem: Working on a highly modular app using cocoapods, we have many static frameworks with test specs. I've created an auto generated host app that takes all of the local podspecs and includes them in a podfile, with their test specs. This solved the first major issue in that we can build once (instead of once per module). There are 2000+ tests and close to ~60 modules currently. Each module is pretty small, so running the tests for most modules it takes longer for xctest to do it's setup and teardown than it does to actually run the tests.

1 Like

@cltnschlosser have you find a way of running the tests of multiple targets in parallel ?

This PR seems to allow run test in parallel, however, I have the same doubt as you. If I have multiple packages, how can I run all tests in parallel at once.

Hey, I had played around with a spm tool, but I didn't spend enough time on it. I think it ended up being slower or about the same time as running all the tests serially. I think better sim management might help some, but I also think there was quite a bit of overhead from launching xcodebuild multiple times.

It's been a while, but I pushed this up to GitHub if you're interested in what I had.

Since it sounds like you are using spm, there might be a better way to do this within swift-package-manager.

1 Like

This used to be one of the features of GitHub - facebookarchive/xctool: An extension for Apple's xcodebuild that makes it easier to test iOS and macOS apps., and I would like to bring something like it back. swift test --parallel is really nice, and xcodebuild lacking something like that logic tests is definitely a hindrance to modular apps with split test structure.

I've toyed with the idea of just creating one big supermodule for tests across all our modules just to then use xcodebuild's single-target parallelization, but that's less than idea.

Terms of Service

Privacy Policy

Cookie Policy