fastlane: Scan not working with Xcode 7.3

When running scan after installing Xcode 7.3, the test results always show 0 if the tests run successfully: scan --workspace "Project.xcworkspace" --scheme "project" --device "iPhone 6s" --clean --verbose

+--------------------+-------+
|        Test Results        |
+--------------------+-------+
| Number of tests    | 0     |
| Number of failures | 0     |
+--------------------+-------+

If I purposely break a test, the scan command will fail with code 65:

** TEST FAILED **
ERROR [2016-03-22 20:16:31.24]: Exit status: 65
Successfully submitted a crash report. If this is a problem with one of the tools specifically,
please submit an issue on GitHub and attach the following number to it: 'd42bc744e9cdd2c0ece054f74b3ec3e1'
The crash report has been stored locally '/tmp/sentry_d42bc744e9cdd2c0ece054f74b3ec3e1.json'
/Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/error_handler.rb:32:in `handle_build_error': [!] Error building/testing the application - see the log above (RuntimeError)
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/runner.rb:31:in `block in test_app'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane_core-0.39.0/lib/fastlane_core/command_executor.rb:85:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane_core-0.39.0/lib/fastlane_core/command_executor.rb:85:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/runner.rb:23:in `test_app'
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/runner.rb:9:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/manager.rb:10:in `work'
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/commands_generator.rb:41:in `block (2 levels) in run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
    from /Library/Ruby/Gems/2.0.0/gems/fastlane_core-0.39.0/lib/fastlane_core/ui/fastlane_runner.rb:23:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/commands_generator.rb:60:in `run'
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/lib/scan/commands_generator.rb:14:in `start'
    from /Library/Ruby/Gems/2.0.0/gems/scan-0.5.2/bin/scan:6:in `<top (required)>'
    from /usr/local/bin/scan:23:in `load'
    from /usr/local/bin/scan:23:in `<main>'

fastlane 1.67.0 scan 0.5.2

Could it be that something broke with the new XCode or is this issue on my side?

Thanks,

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 65 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Just for some more info, this isn’t isolated to ‘scan’. Mention of changes to XCTest in Xcode 7.3 have affected xcpretty / console output. https://github.com/Quick/Quick/issues/494#issuecomment-200286238

This is not project specific, because I also have the same problem. I believe this is a widespread issue and very high severity that requires immediate fix.

Ok, I’ve found the solution to the problem, and for those of you that still might be in trouble, here is the solution. I’ve run some tests to see what is the root cause - the problem isn’t with scan at all. The problem is tied to the xcpretty library, and to be more precise, to the way how XCTests have changed in xCode 7.3. With a bug that is not letting custom observers to observe for tests until they are inside the dispatch_async blocks, libraries like KIF were not functioning properly (no log output).

Bumping the version of KIF to the latest (after looking in some of the closed issues) has finally solved the problem.

Hope that will help someone in need.

Help sources: https://github.com/kif-framework/KIF/pull/819 https://github.com/Quick/Nimble/pull/271 https://github.com/Quick/Nimble/pull/271/commits/6a50a930ff7d6ba783fcac823a1fc306a55d0f7e https://books.google.pl/books?id=9lQnCgAAQBAJ&pg=PA173#v=onepage&q&f=false (nice book btw, explaining the command line tools and xcpretty pretty well)

Hi folks - I’ve released scan 0.6.1.

This ticket has wound up collecting a lot of different kinds of problem reports, but if you’re having trouble with simulators that fail to boot, could you please upgrade your scan with:

gem update scan

and then try running:

FASTLANE_EXPLICIT_OPEN_SIMULATOR=1 scan

or

FASTLANE_EXPLICIT_OPEN_SIMULATOR=1 fastlane your_lane

depending on how you run scan, and let me know if allows your test runs to succeed? Thanks! 🚀

Sure thing, sorry for the hijack! I thought they might be similar enough.