-
Notifications
You must be signed in to change notification settings - Fork 267
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
[REVIEW] Add Async Support to XCTest #326
Conversation
@swift-ci Please test |
8fae034
to
a7f0054
Compare
|
@swift-ci please test 😇 |
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.
Great progress here! Most of my comments are on the theme of tidying up what we’ve got.
@swift-ci please test ❤️ |
a8fad50
to
331ca10
Compare
This work is now blocking landing swiftlang/swift-corelibs-foundation#3036 |
(because it has asynchronous tests.) |
Co-authored-by: Stuart Montgomery <[email protected]>
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.
Thanks for all the iteration on this, I think it's looking good! Let's see what further work might be needed to get CI into good shape, particularly around the macOS deployment target?
@@ -194,26 +195,24 @@ open class XCTestCase: XCTest { | |||
/// Teardown method called after the invocation of every test method in the | |||
/// class. | |||
open class func tearDown() {} | |||
|
|||
private var teardownBlocks: [() -> Void] = [] |
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.
Nice to have better encapsulation of this now!
@@ -225,33 +224,61 @@ open class XCTestCase: XCTest { | |||
} | |||
} | |||
|
|||
setUp() | |||
} | |||
do { |
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.
Is our behavior here matching Xcode XCTest, in terms of what additional steps of the test we still run and what we report if an async setUp override:
- throws XCTSkip?
- throws some other error?
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.
I believe it should be handling these correctly, due to the following two guards above in handleErrorDuringSetUp(_:)
:
if error.xct_shouldRecordAsTestFailure {
and
if error.xct_shouldSkipTestInvocation {
@swift-ci please test |
The Linux build errored with:
I had forgotten that for platforms building with CMake, we need to add a reference to any new source files to the |
@swift-ci please test |
@swift-ci please test |
* This is due to the latest macOS SDK being unavailable at the moment.
@swift-ci please test ty <3 |
@swift-ci please test ty <3 |
@swift-ci please test thank yoooouu <3 |
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please test |
This seems to have regressed the Windows builds :-( |
This is a work-in-progress pull request that @stmontgomery and I have been working on which adds first-class
async/await
support to the cross-platform XCTest.Please withhold comments until this PR changes from [WIP] to [REVIEW].
17/08/21 Update: This PR has now been opened for review and is being actively iterated on.