Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

OS X SDK unit tests #3406

Merged
merged 1 commit into from
Dec 24, 2015
Merged

OS X SDK unit tests #3406

merged 1 commit into from
Dec 24, 2015

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Dec 23, 2015

Added an XCTest bundle to the osxsdk scheme. For now, it contains some basic tests of shared iOS/OS X code. It can easily be extended to cover more of the SDK, including UI tests via XCTUI.

Unlike what we did on iOS for #830, I’ve integrated the test bundle directly into the project that contains the SDK code, allowing us to write unit tests as opposed to just integration tests.

This PR works toward replacing KIF with XCTUI on iOS, which would eliminate the unreliability in #2734 and allow us to add better tests around user interaction and performance. I started with OS X because everything’s simpler on OS X. 😄

/cc @incanus @friedbunny @jfirebaugh

@1ec5 1ec5 added macOS Mapbox Maps SDK for macOS tests labels Dec 23, 2015
@1ec5 1ec5 self-assigned this Dec 23, 2015
@1ec5 1ec5 changed the title Unit tests OS X SDK unit tests Dec 23, 2015
@1ec5 1ec5 added the iOS Mapbox Maps SDK for iOS label Dec 23, 2015
@jfirebaugh
Copy link
Contributor

Yay!

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 24, 2015

Travis consistently stalls on the xcodebuild test invocation. Hopefully this is something we can address by fiddling with arguments; otherwise, we may be forced to take care of #2776 first.

@friedbunny
Copy link
Contributor

Running locally:

$ make xctest
build: osx/x86_64
host: osx/x86_64
libs: headless=cgl  platform=osx  asset=fs  http=nsurl  
* Recreating project...
Build settings from command line:
    SDKROOT = macosx10.11

xcodebuild: error: Scheme osxsdk is not currently configured for the test action.

make: *** [xctest] Error 66

@friedbunny
Copy link
Contributor

After cleaning, xctest hangs with the same output but without the above error.

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 24, 2015

xcodebuild test requires a shared scheme, but schemes don’t get generated in the first place unless you open the project in Xcode. The xcodeproj gem can generate shared schemes, but they don’t include test targets: CocoaPods/Xcodeproj#139. make itest works because it relies on a checked-in Xcode project, but I don’t want to go that route until we properly implement #3275.

@1ec5
Copy link
Contributor Author

1ec5 commented Dec 24, 2015

Hilariously, in the end, all that works is opening the project in Xcode and waiting several seconds. I tried using fswatch, but unfortunately Xcode doesn’t generate the schemes atomically. A lot of this would’ve been simpler if Xcode’s AppleScript dictionary worked as advertised.

Added an XCTest bundle to the osxsdk scheme. It contains some basic tests of shared iOS/OS X code.
@1ec5 1ec5 merged commit ceb0790 into master Dec 24, 2015
@1ec5 1ec5 removed the in progress label Dec 24, 2015
@1ec5 1ec5 deleted the 1ec5-osx-tests branch December 24, 2015 23:06
This was referenced Apr 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants