Is Swift Testing appropriate for use in non-concurrent environments?

Generated on 8/12/2024

1 search

Swift Testing is designed to work effectively in concurrent environments, leveraging Swift's concurrency features such as async/await and actor isolation. However, it can also be used in non-concurrent environments. While parallel testing is enabled by default to maximize performance, you can run tests serially if needed. This is achieved by using the serialized trait, which ensures that tests run one at a time. Although running tests serially may lose some performance benefits, it is possible and appropriate for non-concurrent environments.

For more details on running tests serially, you can refer to the session Go further with Swift Testing (23:16).