Skip to content

[build-script] Build & test XCTest (on OS X, too) #1316

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

Merged
merged 1 commit into from
Feb 24, 2016

Conversation

modocache
Copy link
Contributor

What's in this pull request?

Allow swift-corelibs-xctest to be built and tested on Linux and OS X, via utils/build-script --xctest --test.

On OS X, XCTest is built via xcodebuild, which has been possible since swiftlang/swift-corelibs-xctest#47. It's tested via the "SwiftXCTestFunctionalTests" Xcode target. Keep in mind that xcodebuild must be configured on the host machine to use a Swift toolchain that can build XCTest--as of swiftlang/swift-corelibs-xctest#48, that would be swift-DEVELOPMENT-SNAPSHOT-2016-02-08 or later.

On Linux, XCTest is built and tested via the project's build_script.py, which has been possible since swiftlang/swift-corelibs-xctest#46.

Why merge this pull request?

Although swift-corelibs-xctest has been added to Apple CI in swiftlang/swift-corelibs-xctest#45 (comment), the build script triggered doesn't actually run the test suite. Because the project has lacked CI that can run the test suite, pull requests that break the tests have been merged in the past (swiftlang/swift-corelibs-xctest#33 and swiftlang/swift-corelibs-xctest#44, for example). Allowing the build script to test swift-corelibs-xctest will keep swift-corelibs-xctest more stable.

What are the downsides of merging this pull request?

  • On OS X, xcodebuild must be invoked with a toolchain capable of building swift-corelibs-xctest. The build script changes in this pull request do not enforce a specific toolchain (I'm not sure if this is possible). Invoking the build script with the wrong toolchain will cause the build script to fail. Keep in mind that this is still better than the current situation, in which OS X will attempt to run the Linux-only swift-corelibs-xctest build script.
  • There are some situations in which both swift-corelibs-xctest and this build script will need to be updated at the same time. For example, Asynchronous testing API [AsyncXCTest 6/6] swift-corelibs-xctest#43 adds a dependency on swift-corelibs-foundation, which necessitates a change in how swift-corelibs-xctest is built.

@modocache
Copy link
Contributor Author

/cc @mike-ferris-apple and @briancroom for their swift-corelibs-xctest expertise.

@gribozavr
Copy link
Contributor

@swift-ci Please test

@briancroom
Copy link
Contributor

@modocache Xcode 7.3 beta introduces the possibility of requesting to use a specific Swift toolchain for command line tools (see Release Notes). I'm not sure what kind of configuration the OS X CI workers have, though.

Regardless, I'm really excited to see progress on this front. Thanks for all your effort here.

@modocache
Copy link
Contributor Author

This needs to be updated, since swiftlang/swift-corelibs-xctest#50 added an additional parameter to the XCTest build script.

Allow swift-corelibs-xctest to be built and tested on Linux and OS X,
via `utils/build-script --xctest --test`.

On OS X, XCTest is built via `xcodebuild`, which has been possible since
swiftlang/swift-corelibs-xctest#47. It's tested via
the "SwiftXCTestFunctionalTests" Xcode target. Keep in mind that
`xcodebuild` must be configured on the host machine to use a Swift
toolchain that can build XCTest--as of
swiftlang/swift-corelibs-xctest#48, that would be
`swift-DEVELOPMENT-SNAPSHOT-2016-02-08` or later.

On Linux, XCTest is built and tested via the project's
`build_script.py`, which has been possible since
swiftlang/swift-corelibs-xctest#46.
@modocache modocache force-pushed the build-script-impl-xctest branch from 0f40de2 to ac5f7c7 Compare February 19, 2016 05:24
@modocache
Copy link
Contributor Author

@gribozavr This should be good to go! Could you try CI again, and if it passes would you consider merging this? 🙇

@gribozavr
Copy link
Contributor

@swift-ci Please test

@modocache
Copy link
Contributor Author

There appear to be failures in the OS X Swift test suite, which are unrelated. The XCTest tests would normally run after the Swift tests, but the CI process exits early.

The Linux tests pass, though! I can see all five of our test cases are passing. 😄

@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@modocache Yes, we had a massively broken 'master' branch at that time. Let's re-run the tests.

@gribozavr
Copy link
Contributor

The patch LGTM unless CI says otherwise.

@modocache
Copy link
Contributor Author

@gribozavr Looks like a swift-package-manager failure on Linux, the same you mention in #1391.

@gribozavr
Copy link
Contributor

@modocache Yes. Unfortunately xctest tests are being run after swiftpm, so that failure is preventing this PR from being actually tested.

@modocache
Copy link
Contributor Author

Haha, ironically three days ago it was OS X that wasn't being tested, whereas this time it's Linux! #1316 (comment) 😂

Here's hoping for better luck and a green master branch soon!

@modocache
Copy link
Contributor Author

@gribozavr If the CI's looking greener today, could we retry this pull request? Would love to see it merged. 🙇

@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@swift-ci Please test

@modocache
Copy link
Contributor Author

@gribozavr Wow, it worked! Thanks for your persistence! 😅

gribozavr added a commit that referenced this pull request Feb 24, 2016
[build-script] Build & test XCTest (on OS X, too)
@gribozavr gribozavr merged commit 225497d into swiftlang:master Feb 24, 2016
@modocache modocache deleted the build-script-impl-xctest branch February 24, 2016 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants