Skip to content

Conversation

petermolnar-dev
Copy link

Adding highlight and link to the XCTest Migration document to help understand and mitigate the parallel-by-default test execution.

Motivation:

Handling #863

Modifications:

Adding the Important aside, highlighting the parallel-by-default nature of Swift Testing test execution while migrating from XCTest.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@grynspan
Copy link
Contributor

@iamleeg Would you please help us review?

@grynspan grynspan added documentation 📚 Improvements or additions to documentation enhancement New feature or request concurrency 🔀 Swift concurrency/sendability issues labels Jun 26, 2025
@grynspan grynspan added this to the Swift 6.x milestone Jun 26, 2025
@grynspan
Copy link
Contributor

@petermolnar-dev It looks like you've opened this PR and made changes using two separate GitHub accounts. Was this intentional?

Copy link
Contributor

@iamleeg iamleeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this PR!

@@ -84,6 +84,8 @@ concurrency safety:
For more information about suites and how to declare and customize them, see
<doc:OrganizingTests>.

> Important: While XCTest test cases running sequentially by default, the test execution happens in parallel by default in Swift Testing. See the [Run tests sequentially](#Run-tests-sequentially) section in this document for further information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence doesn't say anything that isn't already covered in "Run tests sequentially," below. Additionally, the aside's content isn't really relevant to the topic of this section, which is about creating test suites. I'd recommend thinking about the structure of this content differently.

Is there something that "Run tests sequentially" ought to tell developers, but doesn't? If so, add information there.

Is there something that "Convert test classes" ought to tell developers about concurrency, so they know to read "Run tests sequentially"? If so, work that into the prose in this section.

If your goal is to ensure that developers remember to think about concurrency, they should probably also remember to think about some of the other points in this doc. Perhaps you need to expand the Overview, to give developers a list of important points to consider when they migrate tests.

@stmontgomery
Copy link
Contributor

Hi @petermolnar-dev, thank you for the PR. It looks like your motivation for submitting it was to resolve the issue #863, is that correct? We realized upon reviewing that issue that it was probably resolved already by @iamleeg's subsequent PR #960 — or at least, it's not clear what additional information beyond that should be added — we just forgot to close #863 after #960 was merged.

I'm going to close this PR for now given that. However, if you feel there is additional guidance on the Migrating document which should still be added, please clarify and we can re-open and reconsider this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concurrency 🔀 Swift concurrency/sendability issues documentation 📚 Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Migrating a test from XCTest" does not mention parallel-by-default
5 participants