-
Notifications
You must be signed in to change notification settings - Fork 140
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
Cedar spec bundles don't execute in Xcode 7 Beta #333
Comments
Interesting, I wouldn't have thought that test bundles would have regressed in the beta. If anything, I would have anticipated that spec suites would have stopped working. Were you able to find out anything else? Were there any exceptions raised and recovered from when you ran the tests? |
It is probably the result of the test case discovery mechanism changing. I don't assume it is an Xcode regression. Suites probably still work fine, though I haven't had a chance to test it yet. This may reignite the conversation about inheriting directly from XCTestCase and friends. On Tue, Jun 9, 2015 at 7:34 AM, Tim Jarratt notifications@github.com
|
There are some other lovely test output functionalities in Xcode 7.
|
I can confirm that test bundles don't run out of the box and that the xctest discovery process is different. Right now Cedar checks for an argument that is either -XCTest or -XCTestScopeFile. These arguments are no longer passed when running the test bundle. I have changed the discovery method to a different approach that does detect xctest runs, but the bundle still doesn't run any of the tests. It seems like the swizzle of defaultTestSuite is not actually getting called by the xctest system. |
I just had an opportunity to speak with one of the Apple engineers responsible for testing framework development. After looking at my code, he suspects that whatever Cedar is doing to bootstrap tests doesn't depend on publicly available APIs and so is vulnerable to this kind of problem with each new Xcode release. He pointed me to some new APIs available in Xcode 7, specifically the |
Outstanding. Thanks for following up! On Wed, Jun 10, 2015 at 4:03 PM, Alex Basson notifications@github.com
|
Hey all, We discovered a few more issues when trying out Xcode 7 on our current project which uses test bundles.
Hope this helps! |
I was investigating the symbolication failures with @elanakoren yesterday and we discovered that it DOES work. Cedar reaches into the app bundle for Xcode to run |
I'm not sure this is the same issue. Is it? On Tue, Jul 21, 2015 at 10:03 AM, Tim Jarratt notifications@github.com
|
Well the symbolication tests start passing when we change to
...so it very much feels to be the same issue to me. Granted, I know very little about symbolication and why |
Yes Tim, you have found the issue with Cedar’s own symbolication tests, however I don’t think this is related to the headline of this email thread. Please correct me if I’m wrong. On Tue, Jul 21, 2015 at 2:26 PM, Tim Jarratt notifications@github.com
|
Oh, I see. I was responding to some of the additional issues that @mjstallard found related to Xcode 7. Perhaps those should be logged as a separate issue. Sorry for the noise! |
Are there any updates on this? I haven't seen activity on the Xcode7 branch but wanted to double check. |
There's been some slow, steady progress on Xcode 7 support for test bundles @joemasilotti. In the past few weeks we've fixed symbolication and discovered the root cause of why test bundles no longer have reporter output in the console after specs finish running. To the best of my knowledge, running your specs in Xcode 7 beta 5 with Cedar in a test bundle should work today, using the |
Have you had any other, unrelated issues with Xcode 7 and test bundles lately, @joemasilotti? |
Not a single run of my test suite has completed on Xcode 7. Of the fifteen or so times I've attempted to do so, I receive These seem to be occurring on or around view lifecycle methods and when instantiating If it helps, I'm running ~1600 tests but the suite fails before getting to even 100 of them. |
Could you provide a sanitized backtrace? It's not clear to me if the exception is being caused by Cedar or maybe something else from your description. If the backtrace is pretty bare, you might try enabling NSZombies and see if there's anything there. I also saw something similar helping a pivot upgrade from Xcode 6 to 7, but the error seemingly went away when we cleaned the build folder. While I hate cargo-culting that "solution", that's also probably a relevant thing to try. |
Well this might all be moot now. Running my suite against Beta 6 raises I know that a bunch of XCTest stuff changed with this release, specifically XCTestObservationCenter and XCTestProbe. |
Absolutely right, Joe. The Xcode 7 branch uses XCTestObservationCenter to hook into XCTest's runtime in a somewhat saner way than we had before in the past. So far, I know this runs Cedar's specs, some specs for my own projects, the iOS school specs, and a few other SF pivots' projects as well, but I wouldn't be too surprised if there weren't more lingering issues to resolve. |
That's reassuring. Has anyone had a chance to try this with Beta 6? I understand that that's a huge ask as it was released only yesterday. |
I'm pretty sure the WebKit stuff has internal async going on. I would consider it a red herring... On Tue, Aug 25, 2015 at 5:04 PM, Joe Masilotti notifications@github.com
|
@akitchen meaning I have other issues to fix or Cedar is responsible for the crash? The crash only occurs when testing the app with Xcode 7, not when running the app in Xcode 6 or 7, nor when testing the app with Xcode 6. |
I would be very surprised if cedar is causing your EXC_BAD_ACCESS crash. Cedar runs your specs synchronously on the main queue. A crash like this is typically due to side effects of something your code under test is doing. Do any tests run before this crash happens? Can you binary search to isolate the test or group of tests which are involved? It would also be interesting to know if you are faking or spying instances of certain framework classes. This is really the only case where the crash could be related to cedar. Or do you think it is happening right at startup? On Tue, Sep 1, 2015 at 12:26 PM, Joe Masilotti notifications@github.com
|
Me too, which is why this issue has me so confused. Any test that tries to instantiate a If it helps, I've attached a screenshot of the stack and exception. |
You might remember that we tend to fully stub out the UIWebView in testing Could you share a simple test as a gist which demonstrates this? On Tue, Sep 1, 2015 at 1:30 PM, Joe Masilotti notifications@github.com
|
Yea, that's a good point. I should probably be doing that anyway. Thanks for the insight. I'm having trouble reproducing this in a fresh project, which makes me think there is something else I'm not thinking about. I'll post something when I can get it to reliably fail. Thanks for the help. |
Finally nailed down the issue. That being said it doesn't sound like it's an issue related to Cedar. Thanks for walking me through the debugging process though, it was a huge help! I'm going to open an issue in PCK to see if there are any better ways to accomplish what I am trying to do. |
Thanks for following up with more info @joemasilotti Where does this leave us on this particular issue then? |
It's not related to Cedar at all. I am able to reproduce the issue with a plain old |
Thanks for all the feedback and testing everyone. Now that this has been merged into master, I'm more comfortable closing this. Please open new issues for any new regressions that you may find while writing happy little Cedar specs. |
The
ios-school
project uses a spec bundle to run tests. This works fine in Xcode 6.3. In Xcode 7 Beta, the project builds, but no tests are run. The console output is simplyExecuted 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds
.The text was updated successfully, but these errors were encountered: