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

[scan] Add automatic detection of derived data path #5563

Merged
merged 14 commits into from
Aug 10, 2016
Merged

Conversation

KrauseFx
Copy link
Member

@KrauseFx KrauseFx commented Aug 1, 2016

This is used to put it into the lane context from the fastlane action. The path is useful when following actions need to access the output of the tests

This is first used in https://github.com/KrauseFx/trainer

This is used to put it into the lane context from the fastlane action. The path is useful when following actions need to access the output of the tests

This is first used in https://github.com/KrauseFx/trainer
@KrauseFx
Copy link
Member Author

KrauseFx commented Aug 1, 2016

Tests are failing, will take a look as it seems like it behaves differently on Circle

@KrauseFx
Copy link
Member Author

KrauseFx commented Aug 1, 2016

Ready for review

# => /Users/.../Library/Developer/Xcode/DerivedData/app-bqrfaojicpsqnoglloisfftjhksc/Build/Products/Release-iphoneos
# We need to go one folder up, since tests don't run inside 'Release-iphoneos'
# but in 'Debug-iphonesimulator'
default_path = File.join(File.expand_path("..", default_path), "Debug-iphonesimulator")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use File.dirname(default_path) to go up one folder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know some people in the past have tried to make changes to allow scan to run on real devices. Does this Debug-iphonesimulator path assume too much?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, updated to File.dirname, thanks for letting me know. Great catch regarding running scan on real devices, I'll investigate this now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what's the status on #5159 in general, and if we want to go finish things up and merge?
It seems like the best approach here is to check if the current run is for the simulator or for the device and then use Debug-iphonesimulator or Debug-iphoneos (or similar)

However the derived data path is set to this, so even for the real device it will just work, it just stores the data in a separate directory.

I wonder if instead it would make sense to just use a fastlane derived data path. I'll give it some more thought tomorrow.

@mfurtak
Copy link
Contributor

mfurtak commented Aug 2, 2016

I added a couple of comments/questions.

@mfurtak
Copy link
Contributor

mfurtak commented Aug 3, 2016

LGTM, if you decide you want to move forward with it.

@KrauseFx KrauseFx self-assigned this Aug 10, 2016
@KrauseFx
Copy link
Member Author

@mfurtak I added one more commit, could you do another review on this? 👍

@mfurtak
Copy link
Contributor

mfurtak commented Aug 10, 2016

👍

@KrauseFx KrauseFx merged commit 497ca7a into master Aug 10, 2016
@KrauseFx KrauseFx deleted the scan-derived-data branch August 10, 2016 17:42
KrauseFx added a commit that referenced this pull request Aug 10, 2016
* [scan] Add automatic detection of derived data path (#5563)
* [scan] Skip showing GitHub issues for build errors (#5609)
@KrauseFx KrauseFx mentioned this pull request Aug 10, 2016
KrauseFx added a commit that referenced this pull request Aug 10, 2016
* [scan] Add automatic detection of derived data path (#5563)
* [fastlane] Summary table show failed action in red (#5672)
* Make download_dsyms work for appletvos (#5642)
* Add easier access to lane context from actions (#5572)
* [Carthage] Add option to pass in specific toolchain
* Updated Actions README to clarify last_git_commit (#5627)
* Fix require for gem jira-ruby (#5605)
* [fastlane] Update spaceship dependency (#5659)
* [fastlane] Fix printing verbose information for PluginFetcher (#5670)
* [fastlane] Update available plugins (#5671)
* [fastlane] Fix plugin search (#5568)
* Update Actions file (#5450)
* Update versions of tools (#5566)
* Improve English in docs output (#5562)
* Update carthage action documentation for the dependancies and toolchain options (#5552)
* [fastlane] Update dependencies (#5553)
* hipchat: escape channel name if it is not escaped yet (#5547)
* Fix typo (#5532)
* Update import_from_git :branch parameter documentation (#5533)
* Update junit_generator to use Helper.gem_path (#5462)
KrauseFx added a commit that referenced this pull request Aug 10, 2016
* [scan] Version bump

* [scan] Add automatic detection of derived data path (#5563)
* [scan] Skip showing GitHub issues for build errors (#5609)

* [scan] Version bump
KrauseFx added a commit that referenced this pull request Aug 10, 2016
* [scan] Add automatic detection of derived data path (#5563)
* [fastlane] Summary table show failed action in red (#5672)
* Make download_dsyms work for appletvos (#5642)
* Add easier access to lane context from actions (#5572)
* [Carthage] Add option to pass in specific toolchain
* Updated Actions README to clarify last_git_commit (#5627)
* Fix require for gem jira-ruby (#5605)
* [fastlane] Update spaceship dependency (#5659)
* [fastlane] Fix printing verbose information for PluginFetcher (#5670)
* [fastlane] Update available plugins (#5671)
* [fastlane] Fix plugin search (#5568)
* Update Actions file (#5450)
* Update versions of tools (#5566)
* Improve English in docs output (#5562)
* Update carthage action documentation for the dependancies and toolchain options (#5552)
* [fastlane] Update dependencies (#5553)
* hipchat: escape channel name if it is not escaped yet (#5547)
* Fix typo (#5532)
* Update import_from_git :branch parameter documentation (#5533)
* Update junit_generator to use Helper.gem_path (#5462)
beeva-diegogarcia added a commit to beeva-diegogarcia/fastlane that referenced this pull request Aug 11, 2016
* upstream/master: (42 commits)
  [fastlane] Version bump (fastlane#5693)
  [fastlane] Update scan dependency (fastlane#5691)
  [scan] Version bump (fastlane#5690)
  [fastlane] Update internal dependencies (fastlane#5692)
  [fastlane] Update produce dependency (fastlane#5695)
  [produce] Version bump (fastlane#5687)
  [produce] Add waiting for new app to appear (fastlane#5688)
  [fastlane] Add new team_id option to latest_testflight_build_number (fastlane#5668)
  [produce] Update spaceship dependency (fastlane#5689)
  Updated Actions README to clarify last_git_commit (fastlane#5627)
  [scan] Add automatic detection of derived data path (fastlane#5563)
  Fix require for gem jira-ruby (fastlane#5605)
  [match] Add information about the force (fastlane#5658)
  [fastlane] Update spaceship dependency (fastlane#5659)
  [deliver] Update spaceship dependency (fastlane#5664)
  [spaceship] Add test for auto-setting of scaling attribute for screenshots (fastlane#5666)
  [fastlane] Fix printing verbose information for PluginFetcher (fastlane#5670)
  [fastlane] Update available plugins (fastlane#5671)
  Fix a typo in the two factor implementation (fastlane#5682)
  [fastlane] Summary table show failed action in red (fastlane#5672)
  ...
@cbalea
Copy link

cbalea commented Aug 11, 2016

@KrauseFx After updating to scan 0.11.0, Slather stops working. I get this error from Slather:

03:27:30 Slathering...
03:27:31 /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/lib/slather/project.rb:177:in `profdata_coverage_dir': No coverage directory found. (StandardError)
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/lib/slather/project.rb:410:in `block in find_binary_files'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/lib/slather/project.rb:409:in `each'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/lib/slather/project.rb:409:in `find_binary_files'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/lib/slather/project.rb:344:in `configure_binary_file'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/lib/slather/project.rb:240:in `configure'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/lib/slather/command/coverage_command.rb:51:in `execute'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/subcommand/execution.rb:11:in `execute'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/slather-2.3.0/bin/slather:17:in `<top (required)>'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/bin/slather:23:in `load'
03:27:31    from /Users/jenkins/.rbenv/versions/2.2.3/bin/slather:23:in `<main>'
03:27:31 No coverage directory found.
03:27:31 
03:27:31    Are you sure your project is generating coverage? Make sure you enable code coverage in the Test section of your Xcode scheme.
03:27:31    Did you specify your Xcode scheme? (--scheme or 'scheme' in .slather.yml)
03:27:31    If you're using a workspace, did you specify it? (--workspace or 'workspace' in .slather.yml)

My slather.yml file and scan command didn't change. They are the same I use since scan version 0.8.0:
scan --clean --scheme MyCompany -w MyCompany.xcworkspace --code_coverage -o fastlane/test_output/unit

slather.yml:

coverage_service: cobertura_xml
xcodeproj: MyCompany.xcodeproj
workspace: MyCompany.xcworkspace
scheme: MyCompany
output_directory: .
ignore:
  - ExamplePodCode/*
  - ProjectTestsGroup/*
  - appium-tests/*
  - ci/*
  - fastlane/*
  - Pods/*
  - .github/*

@cbalea
Copy link

cbalea commented Aug 11, 2016

Side note: using scan 0.10.1 works.

@KrauseFx
Copy link
Member Author

@cbalea thanks for the report. Could you please share the complete output when running scan? Do you use fastlane? Could you create a new issue on the fastlane repo, and follow the template, so that we have all required information 👍

@KrauseFx
Copy link
Member Author

@cbalea I think I found the issue, I'll have a fix prepared in a minute

@KrauseFx
Copy link
Member Author

@cbalea I pushed #5711, which should fix the issue 👍

@fastlane fastlane locked and limited conversation to collaborators Feb 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants