Open mkanthan opened 7 years ago
@mkanthan if I understand correctly, the problem you're facing is that it's difficult to get the original output printed by Cedar under Xcode 7 with Xcode 8 and the latest ios-sim
?
Before, with Xcode 7 and ios-sim
Oct 13 20:10:03 My-MBP Specs[69607]: 508 examples, 0 failures, 5 pending
After, with Xcode 8
Oct 13 20:10:03 My-MBP Specs[69607]: 508 examples, 0 failures
Oct 13 20:10:03 My-MBP Specs[69607]: , 5 pending
That sounds mighty frustrating. I don't know how much we can do, as Cedar maintainers to help out here.
I personally, really truly dislike Test Bundles (for a variety of reasons), and I'm glad to hear you've been using standalone "spec suites" with Cedar. Unfortunately, this has historically meant trading more reasonable test execution for less well supported automated test running (with ios-sim
and similar tools).
I don't think we'd want to change the call to printf
to NSLog
immediately, since it would end up making the default reporter output significantly messier in a lot of situations. It really seems like ios-sim
needs to handle lines printed to stdout better. Perhaps there's some room for Cedar to print better, but I'm not entirely sure what that would be without more research.
I've also noticed that ios-sim
is deprecated in favour of ioslib, which appears to be an npm package that exposes javascript functions that allow you to install and run apps on either a simulator or real device.
I haven't tried that out yet, but it looks promising.
It's actually very different with XCode 7 + ios-sim 3.1.1. It was nearly Identical to the XCode console output:
...
. should return the sound files for instructions, prompt icons and every alphabet of higher difficulty spelling tasks which need the full keyboard
LGVideoAccess
P is pending
PENDING LGLoginViewController webView:shouldStartLoadWithRequest:navigationType:navigationType: when the URL is for creating an account is pending
PENDING LGAppDelegate application:didFinishLaunchingWithOptions: should copy the database from the mainbundle to the documents directory
PENDING LGAppDelegate application:didFinishLaunchingWithOptions: should ask LGStoreKitFacade to observe purchase transactions
PENDING LGViewController when the URL scheme is 'video' is pending
PENDING LGVideoAccess is pending
Finished in 32.4752 seconds
508 examples, 0 failures, 5 pending
You'll notice that the log prefixes such as Oct 13 20:10:03 My-MBP Specs[69607]:
are gone, and I'm able to see the test copy.
I agree with your comment about disliking Test bundles - I do like my current route because I'm able to run this as part of a rake task which runs other RSpec and Jasmine tests. I will check out ioslib.
Since upgrading, I've been on Phonegap's ios-sim, and I believe I found an issue related to their logging which no longer logs to stdout: https://github.com/phonegap/ios-sim/issues/181
Before my massive upgrade, I was running XCode 7.3.1, and ios-sim 3.1.1, with Cedar 0.13.1 and all was working fine. I have Cedar set up in the "standalone" configuration and have a rake task which executes the xcodebuild command and runs the Specs in ios-sim. Running the Specs target from XCode works as well. I used the Cedar Rakefile from the templates with some modifications:
I won't post the whole Rakefile here because I believe it's irrelevant.
Enter XCode 8/Cedar 1.0. Upon upgrading and running my
rake Specs
command - when it executes theios-sim launch ...
command, I'm greeted with an error:Failed to find class DTiPhoneSimulatorSystemRoot at runtime.
After digging through ios-sim's repository, I learned that the
DTiPhoneSimulatorSystemRoot
is not present in the newest XCode, prompting me to upgrade (no longer viabrew
- you now have to install ios-sim vianpm
). I've upgraded to ios-sim 5.0.8. Upon runningrake Specs
, it seems to run, but the task no longer completes, and I no longer get the same test output. Instead, I get most of XCode's warnings and such:Upon doing some more digging through ios-sim's Issues, it seems they changed the way they log the output, and it seems to be ignoring the
printf
statement inCDRDefaultReporter.m
on line 97. Changing this to an NSLog gets me a tad further:Now the output becomes:
So now, I get some partial test output and the task exits when it sees
0 failures
printed in the log. Ideally, I'd want this to work on par with the way it used to, however, I'm not sure what the scope is. Is there any way to get this to print similar to the XCode console when running a standalone Specs target?