Skip to content
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

Replace AsyncTestHelper with XCTestExpectation #2200

Merged
merged 6 commits into from Aug 7, 2014

Conversation

@astralbodies
Copy link
Member

astralbodies commented Aug 6, 2014

Closes #1613

Brings all unit tests green and removes the former AsyncTestHelper class which was fundamentally flawed since it was using a shared global variable to store the semaphore. Now every asynchronous test uses an XCTestExpectation instance and if the expectation needs to be fulfilled by the main context saving, it is set on CoreDataTestHelper.testExpectation.

This requires Xcode 6 beta 5 or greater to execute.

2014-08-06_10-07-19

@astralbodies astralbodies added the testing label Aug 6, 2014
@astralbodies

This comment has been minimized.

Copy link
Member Author

astralbodies commented Aug 6, 2014

cc: @sendhil since you wanted to get this project building in Travis CI

@michaelbeil

This comment has been minimized.

Copy link

michaelbeil commented Aug 7, 2014

Looking great.

@astralbodies

This comment has been minimized.

Copy link
Member Author

astralbodies commented Aug 7, 2014

@koke @jleandroperez how does this look to you guys?
@h4xnoodle Looping you in since you helped create the first semaphore-based solution and thought you'd like to see how we've iterated!

@koke

This comment has been minimized.

Copy link
Member

koke commented Aug 7, 2014

This looks much better 👏 👏
Using semaphores seemed like a good idea at the time, but we outgrew it quite fast

@astralbodies

This comment has been minimized.

Copy link
Member Author

astralbodies commented Aug 7, 2014

I agree @koke - I think it was fine for Core Data alone but then using the same mechanism in other async tests starting showing the limitations.

@jleandroperez

This comment has been minimized.

Copy link
Contributor

jleandroperez commented Aug 7, 2014

@astralbodies looking just great!!

:shipit:

astralbodies added a commit that referenced this pull request Aug 7, 2014
…ations

Replace AsyncTestHelper with XCTestExpectation
@astralbodies astralbodies merged commit 1a64423 into develop Aug 7, 2014
@astralbodies astralbodies deleted the issue/1613-test-expectations branch Aug 7, 2014
@sendhil

This comment has been minimized.

Copy link
Contributor

sendhil commented Aug 7, 2014

loki yeahhhh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.