-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an overview of test serialization to the XCTest migration guide #960
Add an overview of test serialization to the XCTest migration guide #960
Conversation
```swift | ||
// Before | ||
class RefrigeratorTests : XCTestCase | ||
func testLightComesOn() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions are all marked async
, but none of them uses await
and all of them use try
. Did you mean to mark them throws
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I just followed the existing examples in this article, for example the one in "Annotate known issues" that starts at line 574. Should we take a look at all of the examples in this article and decide what their signatures should be?
Fixes #863 |
@Column { | ||
```swift | ||
// Before | ||
class RefrigeratorTests : XCTestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class RefrigeratorTests : XCTestCase | |
class RefrigeratorTests : XCTestCase { |
Documentation changes only, can skip CI. |
class RefrigeratorTests : XCTestCase { | ||
func testLightComesOn() throws { | ||
try FoodTruck.shared.refrigerator.openDoor() | ||
XCTAssertEqual(FoodTruck.shared.refrigerator.lightState == .on) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertEqual(FoodTruck.shared.refrigerator.lightState == .on) | |
XCTAssertEqual(FoodTruck.shared.refrigerator.lightState, .on) |
(Same comment in the XCTest below as well)
…960) Describe test serialization in the article about migrating tests from XCTest. ### Motivation: Because XCTest runs tests in a suite serially by default, tests that people migrate from XCTest may encounter issues if they run in parallel. ### Modifications: Add an example of serializing a test suite to the migration guide, along with links to the docs about test parallelization. ### Result: The documentation on migrating tests from XCTest includes guidance on serializing tests within a suite. ### Checklist: - [X] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [X] If public symbols are renamed or modified, DocC references should be updated.
…uide (#965) - **Explanation**: Updates the article on migrating tests from XCTest to tell developers about test serialization. - **Scope**: Documentation updates. - **Issues**: #863 - **Original PRs**: #960 #963 - **Risk**: Purely documentation updates, no risk to the release. - **Testing**: Build documentation and read Migrating a test from XCTest. - **Reviewers**: @grynspan @stmontgomery
Describe test serialization in the article about migrating tests from XCTest.
Motivation:
Because XCTest runs tests in a suite serially by default, tests that people migrate from XCTest may encounter issues if they run in parallel.
Modifications:
Add an example of serializing a test suite to the migration guide, along with links to the docs about test parallelization.
Result:
The documentation on migrating tests from XCTest includes guidance on serializing tests within a suite.
Checklist: