fastlane-community / xcov Goto Github PK
View Code? Open in Web Editor NEWNice code coverage reporting without hassle
License: MIT License
Nice code coverage reporting without hassle
License: MIT License
Hello,
I got a ZeroDivisionError. The crash report has been submitted. The number is dbaf0b8d5f8062731ccd1b662620d467.
best,
steven
is this possible to Ignore list of classes located in folder by reference folder without add name of classes
Is there any way to hide the ignored files on the HTML report?
Currently they appear on the report having 0% coverage.
First of all, I really like this project. However I think calculating project's code coverage by simply averaging libraries' code coverages can be misleading. In my opinion it should be calculated using formula total number of lines covered / total number of lines
.
Furthermore I would love to see [number of lines covered] / [number of lines]
in reports as well.
Everyone I run xcov I am getting 0%
I created a new Project with some quick code and Xcode is showing the count beside each function inside the IDE.
My Command
`xcov -s AutoTest -p ./AutoTest.xcodeproj -o ./build/reports/xcov_output
I get the following Output
[14:47:22]: xcrun xcodebuild -list -project './AutoTest.xcodeproj'
[14:47:23]: Skipping file blacklisting as no ignore file was found at path ./.xcovignore+-----------------------------+------------------------------------------+
| Summary for xcov 0.7 |
+-----------------------------+------------------------------------------+
| scheme | AutoTest |
| project | ./AutoTest.xcodeproj |
| output_directory | ./build/reports/xcov_output |
| derived_data_path | /Users/christopher.streel/Desktop/Build/ |
| minimum_coverage_percentage | 0.0 |
| ignore_file_path | ./.xcovignore |
| include_test_targets | false |
| skip_slack | false |
+-----------------------------+------------------------------------------+[14:47:23]: $ /Library/Ruby/Gems/2.0.0/gems/xcov-0.7/lib/xcov-core/bin/xcov-core -s /Users/christopher.streel/Desktop/Build/Logs/Test/42D0D29B-E7A5-4A7D-B5BF-36058F0AE62E.xccoverage -o /var/folders/wz/p18ghh6561v49_s7mgdsvhg1lyr51y/T/report.json20160419-48755-1yu5l3q
[14:47:23]: ▸ Loading...
[14:47:23]: ▸ ------ xCov-Core ------
[14:47:23]: ▸ Opening .xccoverage file at path: /Users/christopher.streel/Desktop/Build/Logs/Test/42D0D29B-E7A5-4A7D-B5BF-36058F0AE62E.xccoverage
[14:47:23]: ▸ Parsing .xccoverage file...
[14:47:23]: ▸ File successfully parsed
[14:47:23]: ▸ Serializing coverage report...
[14:47:23]: ▸ Report successfully serialized
[14:47:23]: ▸ Writing report on disk...
[14:47:23]: ▸ Coverage report successfully created at path: /var/folders/wz/p18ghh6561v49_s7mgdsvhg1lyr51y/T/report.json20160419-48755-1yu5l3q
+--------------+-----------+
| xcov Coverage Report |
+--------------+-----------+
| AutoTest.app | 0% |
+--------------+-----------+
I've attached a screenshot, if you need any more info let me know.
I love the html output, just hope the Cover Coverage gets corrected
Hello, I am currently trying to use xcov as a post execution script on a Xcode bot for CI.
The xcov script works well on my local machine, but when Xcode runs it on the server I get the following result:
[10:10:18]: �[4m�[36m$ xcodebuild -list -workspace Next\ App.xcworkspace�[0m�[0m
+-----------------------------+------------------------------------------------------------------------------------------+
| �[32mSummary for xcov 1.2.0�[0m |
+-----------------------------+------------------------------------------------------------------------------------------+
| workspace | Next App.xcworkspace |
| scheme | Next App |
| output_directory | /Users/ifood/Public/Drop Box |
| derived_data_path | /Users/ifood/Library/Caches/XCSBuilder/Bots/316d4af48eb74f57c380c88679ad949a/DerivedData |
| html_report | true |
| markdown_report | false |
| json_report | false |
| minimum_coverage_percentage | 0 |
| skip_slack | false |
| slack_username | xcov |
| slack_message | Your xcov coverage report |
| ignore_file_path | ./.xcovignore |
| include_test_targets | false |
| only_project_targets | false |
+-----------------------------+------------------------------------------------------------------------------------------+
[10:10:20]: �[4m�[36m$ /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/lib/xcov-core/bin/xcov-core -s /Users/ifood/Library/Caches/XCSBuilder/Bots/316d4af48eb74f57c380c88679ad949a/DerivedData/Logs/Test/256EEBA4-D03A-4B13-8504-C41443936587.xccoverage -o /var/folders/v4/qz1fqlhd6kzd6v5d5wcskv0w0000gn/T/report.json20170420-56524-1wex3x9 --include-lines-info�[0m�[0m
[10:10:20]: ▸ �[35mLoading...�[0m
[10:10:20]: ▸ �[35m------ xcov-core ------�[0m
[10:10:20]: ▸ �[35mOpening .xccoverage file at path: /Users/ifood/Library/Caches/XCSBuilder/Bots/316d4af48eb74f57c380c88679ad949a/DerivedData/Logs/Test/256EEBA4-D03A-4B13-8504-C41443936587.xccoverage�[0m
[10:10:20]: ▸ �[35mParsing .xccoverage file...�[0m
[10:10:20]: ▸ �[35mFile successfully parsed�[0m
[10:10:20]: ▸ �[35mSerializing coverage report...�[0m
[10:10:20]: ▸ �[35mReport successfully serialized�[0m
[10:10:20]: ▸ �[35mWriting report on disk...�[0m
[10:10:20]: ▸ �[35mCoverage report successfully created at path: /var/folders/v4/qz1fqlhd6kzd6v5d5wcskv0w0000gn/T/report.json20170420-56524-1wex3x9�[0m
Looking for related GitHub issues on fastlane/fastlane...
Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run fastlane env
to append the fastlane environment to your issue
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in encode': �[31m[!] "\xC2" on US-ASCII�[0m (Encoding::InvalidByteSequenceError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in
initialize'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in new' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in
parse'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/lib/xcov-core.rb:20:in parse' from /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/lib/xcov/manager.rb:46:in
parse_xccoverage'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/lib/xcov/manager.rb:30:in run' from /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/lib/xcov/commands_generator.rb:41:in
block (2 levels) in run'
from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in call' from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in
call'
from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:153:in run' from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/runner.rb:476:in
run_active_command'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.27.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:40:in run!' from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.4/lib/commander/delegates.rb:15:in
run!'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/lib/xcov/commands_generator.rb:46:in run' from /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/lib/xcov/commands_generator.rb:15:in
start'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.2.0/bin/xcov:6:in <top (required)>' from /usr/local/bin/xcov:23:in
load'
from /usr/local/bin/xcov:23:in `
How can I resolve this issue?
Thank you
Please, why I'm getting this error:
/Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/coveralls_handler.rb:75:in
initialize': No such file or directory - xcov_output/tmp/coveralls_report.json20170928-55649-1dyhfu0 (Errno::ENOENT)
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/coveralls_handler.rb:75:in new' from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/coveralls_handler.rb:75:in
perform_request'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/coveralls_handler.rb:11:in submit' from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/manager.rb:134:in
submit_to_coveralls'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/manager.rb:33:in run' from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/commands_generator.rb:41:in
block (2 levels) in run'
from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in call' from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in
call'
from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.5/lib/commander/command.rb:153:in run' from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.5/lib/commander/runner.rb:476:in
run_active_command'
from /Library/Ruby/Gems/2.0.0/gems/fastlane-2.58.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:64:in run!' from /Library/Ruby/Gems/2.0.0/gems/commander-fastlane-4.4.5/lib/commander/delegates.rb:15:in
run!'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/commands_generator.rb:46:in run' from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/lib/xcov/commands_generator.rb:15:in
start'
from /Library/Ruby/Gems/2.0.0/gems/xcov-1.3.0/bin/xcov:6:in <top (required)>' from /usr/local/bin/xcov:23:in
load'
from /usr/local/bin/xcov:23:in <main>'
Expectation
I don't want to see the sub project in the code coverage report.
Setup
I have a project with an imported subproject
What I've Tried
Hej,
if I add a file name with a wildcard like this:
- *View.swift
no file listed in .xcovignore is not ignored.
Is it possible to use wildcards?
cheers,
steven
Currently, xcov lists all .m files with the right coverage, but they don't seem to be sorted in any meaningful way. Is there a way to alter the sorting?
hey there and thank you for xcov:
scan completes successfully, and then with the following call:
xcov(
workspace: MyWorkspace.xcworkspace",
scheme: "MyScheme",
output_directory: "xcov_output",
slack_url: 'https://hooks.slack.com/services/MyKey'
)
I get:
undefined method 'log' for FastlaneCore::Helper:Module
xcov 0.7
scan 0.7.0
For some reason, the unknown boxes come up for all the emojis in the table:
Emojis for no changes work fine:
The emojis display correct in the comment editor:
And obviously I can replace the emojis and they work fine.
This is using GH Enterprise 2.6. HTML appears to be the same and the emoji is there when I inspect the source. Just won't display properly the first time when coming from CI 😢
Hi,
I created a .xcovignore
file in the default path for xcov
(.fastlane/.xcovignore
) but I keep getting this warning when I run my test suite:
Skipping file blacklisting as no ignore file was found at path ./fastlane/.xcovignore
This creates a problem as I have a number of files I need to ignore to get accurate coverage report. Is this a bug or am I missing something in my setup?
I am using xcov 1.3.1
and fastlane 2.70.3
Thanks for your help.
With the 1.3.0 release suddenly all our CI dependent on Xcov broke.
After investigating the issue it turned out we had to define the output directory as in Xcov.config[:output_directory]
.
This seems to be required after 1.3.0
and could be something you want to either make optional
or more required by adjusting the docs.
Is there a way I can tell xcov to reference multiple schemes? Either by
xcov.report(...)
xcov.report(...)
or
xcov.report([...],[...])
or something else?
Hey,
seems the latest (as of writing this) Fastlane version 2.76.1 needs slack-notifier 2.3.2 but xcov 1.3.x still depends on slack-notifier ~> 1.3.
Could you please update that dependency so slack notifications work again? Thanks!
Hi I have the following configuration:
lane :unit_tests do
scan(
scheme: get_project_name,
destination: 'platform=iOS Simulator,name=iPhone 6,OS=9.0',
code_coverage: true,
output_directory: "fastlane/test_results/"
)
xcov(
workspace: "TestProject.xcworkspace",
scheme: "TestProject",
html_report: true,
skip_slack: true,
ignore_file_path: "./fastlane/.xcovignore",
output_directory: "xcov_output"
)
end
How do I ignore an entire folder?
The code coverage for the app is not generated.
I try to exclude my Pods
folders in .xcovignore
but frameworks associated with are still displayed in HTML. This is only a layout issue because these frameworks are not included in total coverage percent.
Maybe --exclude_target
and --include_target
should be more appropriated for this kind of purpose but it doesn't seem to be working as expected.
Indeed, I have no result when I do something like this :
xcov -w MyApp.xcworkspace -s 'SCHEME' --output_directory xcov_output --include_targets 'TARGET'
.
Maybe I misunderstand something 🤔.
I am running this on macOS. xcov version 1.0.0.
On my system, I have a directory named Common
. It was renamed from common
a while ago, and I had also updated the index on git
. I want this directory to be ignored when using xcov
. In .xcovignore
, adding Common
doesn't work. Strangely, adding common
makes it work.
I think this issue is because the file system on macOS is case insensitive.
I intend to commit .xcovignore
, but doing that would likely break ignore functionality on other systems as the directory created for them would be Common
.
Hi @nakiostudio
Like statet in the title, one of my team mates discovered something odd: files which were added into .xcovignore were also ignored during the coverage calculation (I can see this in the console which files were ignored), but they appear in the .html coverage report (and everywhere is 0%). Is this by intent?
I'm guessing the report format changed?
bundler: failed to load command: fastlane (/Users/chrisbal/.gem/ruby/2.4.0/bin/fastlane)
NoMethodError: [!] undefined method `each' for nil:NilClass
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/coveralls_handler.rb:30:in `block (2 levels) in convert_and_store_coveralls_json'
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/coveralls_handler.rb:25:in `each'
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/coveralls_handler.rb:25:in `block in convert_and_store_coveralls_json'
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/coveralls_handler.rb:23:in `each'
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/coveralls_handler.rb:23:in `convert_and_store_coveralls_json'
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/coveralls_handler.rb:10:in `submit'
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/manager.rb:136:in `submit_to_coveralls'
/Users/chrisbal/.gem/ruby/2.4.0/gems/xcov-1.4.0/lib/xcov/manager.rb:33:in `run'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/actions/xcov.rb:8:in `run'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:257:in `block (2 levels) in execute_action'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:236:in `block in execute_action'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:231:in `chdir'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:231:in `execute_action'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/fast_file.rb:148:in `method_missing'
Fastfile:51:in `block (2 levels) in parsing_binding'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/lane.rb:33:in `call'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/lane_manager.rb:57:in `cruise_lane'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
/Users/chrisbal/.gem/ruby/2.4.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
/Users/chrisbal/.gem/ruby/2.4.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
/Users/chrisbal/.gem/ruby/2.4.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:75:in `run!'
/Users/chrisbal/.gem/ruby/2.4.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/fastlane/lib/fastlane/cli_tools_distributor.rb:107:in `take_off'
/Users/chrisbal/.gem/ruby/2.4.0/gems/fastlane-2.89.0/bin/fastlane:20:in `<top (required)>'
/Users/chrisbal/.gem/ruby/2.4.0/bin/fastlane:22:in `load'
/Users/chrisbal/.gem/ruby/2.4.0/bin/fastlane:22:in `<top (required)>'
Hi there,
Since upgrading to xcov 1.1.1
, I have started getting this error from fastlane:
wrong number of arguments (given 0, expected 1)
I am not sure what if it's something to do with how fastlane launch xcov or xcov directly.
Same issue as described here: fastlane/fastlane#8407
Also, everything works on xcov 1.0.1
Hey there,
I got this issue today. I just set the Xcode version to 9.3 and it seemed they changed some settings concerning the code coverage. The screen now looks like this:
And also when I have a look in the DerivedData folder I can find these files:
But there is no xccoverage
anymore. Maybe they changed the name/format of the coverage file.
Can you confirm this?
1st: Great work. Looks awesome 👍
I was thinking about including this in a pre-push hook, and using the return code to prevent the hook if the coverage percentage is below the given threshold.
In this use case it'd be handy to have a silent switch, which only prints the covered %.
Thank you for a gread work! But I have a question.
Is there any way for posting raw coverage value to Slack?
This means, for example, not 12%
but 12.45%
.
Maybe I need an option to avoid below codes.
https://github.com/nakiostudio/xcov/blob/b4d00172e7277adae5f28f8fe36c19af33600499/lib/xcov/model/base.rb#L13-L17
A project using xcov cannot install the latest version of fastlane 1.101.0 because of the hard dependency on fastlanecore.
A solution would be to update this dependency:
spec.add_dependency 'fastlane_core', '>= 0.44.0', '< 1.0.0'
Im using danger-xcov 0.2.2 not sure if this should be filed there or here. When running xcov with very minimal options I'm seeing an exception. It appears to be related to the changes in #48
# from Dangerfile:14
# -------------------------------------------
# # Add test coverage reports
> xcov.report(
# scheme: "Debug",
# -------------------------------------------
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/ignore_handler.rb:51:in `new'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/ignore_handler.rb:51:in `relative_path'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/ignore_handler.rb:25:in `should_ignore_file_at_path'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/source.rb:19:in `initialize'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/source.rb:72:in `new'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/source.rb:72:in `map'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/target.rb:57:in `block in map'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/target.rb:57:in `map'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/target.rb:57:in `map'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/report.rb:61:in `block in map'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/report.rb:61:in `map'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/xcov-0.12/lib/xcov/model/report.rb:61:in `map'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/danger-xcov-0.2.2/lib/danger_plugin.rb:57:in `report'
from Dangerfile:14:in `block in parse'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/danger-4.0.0/lib/danger/danger_core/dangerfile.rb:199:in `eval'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/danger-4.0.0/lib/danger/danger_core/dangerfile.rb:199:in `block in parse'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/danger-4.0.0/lib/danger/danger_core/dangerfile.rb:195:in `instance_eval'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/danger-4.0.0/lib/danger/danger_core/dangerfile.rb:195:in `parse'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/danger-4.0.0/lib/danger/commands/local.rb:109:in `run'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/gems/danger-4.0.0/bin/danger:5:in `<top (required)>'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/bin/danger:23:in `load'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/bin/danger:23:in `<main>'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
from /Users/pobrien/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
xcov.report(
scheme: "Debug",
workspace: "MyApp.xcworkspace",
)
It sort of looks as though the default value for source_directory
isn't being populated. Specifying it explicitly appears to work.
xCov 0.5
command: xcov -w WORKSPACE.xcworkspace -s SCHEME
return:
Unable to find any .xccoverage file.
Make sure you have enabled 'Gather code coverage' setting on your scheme settings.
Alternatively you can provide the full path to your .xccoverage file.
As we can see, we have result from coverage
File is present in /DerivedData/ folder
This configuration was working on older version
Hello,
I use xcov as apart of the Fastlane suite in both personal and work projects. In the case of my work projects, we use a generic Fastlane setup and simply switch out some environment variables inbetween all our projects, one of which is slack_url
. If we do not have a value for that variable, we just leave it empty(incase we want to provide one later). This causes xcov to throw when trying to ping slack.
After following the stacktrace, I found the issue being the following line inside of slack_poster.rb
:
def run(report)
return if Xcov.config[:skip_slack]
return if Xcov.config[:slack_url].nil? # <-- This one
I feel it should be replaced with .to_s.empty?
in order to prevent falsy values from being used
return if Xcov.config[:slack_url].to_s.empty?
Lastly, I realized that notifier.ping()
throws if the url provided is no longer valid. My suggestion, is to wrap that code with a begin rescue
statement.
...
begin
result = notifier.ping(
Xcov.config[:slack_message],
icon_url: 'https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png',
attachments: attachments
)
UI.message 'Successfully sent Slack notification'.green
rescue Exception => e
UI.error "xcov failed to upload results to slack. error: #{e.to_s}"
end
Here is a PR that fixes these issues: #99
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:27:in `request_obj'
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:21:in `call'
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:8:in `post'
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier.rb:41:in `ping'
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/xcov-1.3.0/lib/xcov/slack_poster.rb:28:in `run'
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/xcov-1.3.0/lib/xcov/manager.rb:107:in `generate_xcov_report'
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/xcov-1.3.0/lib/xcov/manager.rb:31:in `run'
/Users/fabian/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/fastlane-2.68.0/fastlane/lib/fastlane/actions/xcov.rb:8:in `run'
This is my setup:
Fastfile
desc "Coveralls"
lane :coveralls do
xcov(
project: "Project.xcodeproj",
scheme: ENV["BITRISE_SCHEME"],
coveralls_repo_token: ENV["COVERAGE_ACCESS_TOKEN"],
ignore_file_path: "./.xcovignore"
)
end
.xcovignore
# .xcovignore.yml
# Ignore files
- PROJECT/folder/
- PROJECT/folder/*
- PROJECT/folder/*.swift
Is not ignoring the files at that folder, is that right? Or I'm doing it wrong
On some runs I get:
| MTDates.framework | 12% |
| OMGHTTPURLRQ.framework | 0% |
| AFNetworking.framework | 6% |
On other runs I get:
| OMGHTTPURLRQ.framework | 0% |
| AFNetworking.framework | 6% |
| MTDates.framework | 12% |
It would be nice if there were a consistent (and customizable) sort order. For example, first by percentage of coverage, then by alphabetical order.
I'm sorry, we use Fastlane version 2.83 with Xcov version 1.3.2 and slack-notifier plugin 2.3.2.
Since updating to fastlane version 2.83, our Xcov Slack Notification ignores the "slack_username" and "slack_channel" properties.
Do you have any ideas, how to fix this problem?
Xcode version: 8.2.1
Mac OS: 10.11.6
xcov version: xcov 0.12.5
$ xcodebuild -workspace Vodka.xcworkspace -scheme Vodka -destination 'platform=iOS Simulator,name=iPhone 6 Plus' -configuration Debug -derivedDataPath 'build' test
.....
Executed 2 tests, with 0 failures (0 unexpected) in 411.383 (411.388) seconds
** TEST SUCCEEDED **
$ xcov -w Vodka.xcworkspace -s Vodka --configuration Debug -o xcov_output
[11:42:58]: $ xcodebuild -list -workspace Vodka.xcworkspace -configuration Debug
[11:42:59]: Skipping file blacklisting as no ignore file was found at path ./.xcovignore
+-----------------------------+-------------------+
| Summary for xcov 0.12.5 |
+-----------------------------+-------------------+
| workspace | Vodka.xcworkspace |
| scheme | Vodka |
| configuration | Debug |
| output_directory | xcov_output |
| html_report | true |
| markdown_report | false |
| json_report | false |
| minimum_coverage_percentage | 0 |
| ignore_file_path | ./.xcovignore |
| include_test_targets | false |
| skip_slack | false |
+-----------------------------+-------------------+
[11:42:59]: $ xcodebuild clean -showBuildSettings -workspace Vodka.xcworkspace -scheme Vodka -configuration Debug
2016-12-27 11:43:01.010 xcodebuild[17247:761697] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-11758/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/ProjectModel/Capabilities/Xcode3TargetCapabilitiesContext.m:292
Details: Failed to expand identifiers "{(
"group.com.beastbikes.ios"
)}": Error Domain=IDECapabilitiesErrorDomain Code=1 "The operation requires a selected developer portal team." UserInfo={NSLocalizedDescription=The operation requires a selected developer portal team., NSLocalizedRecoverySuggestion=}
Object: <Xcode3TargetCapabilitiesContext: 0x7f9d8dc7f6a0>
Method: -_appIDFeatureStateIncludingEntitlements:
Thread: <NSThread: 0x7f9d8a50f020>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
2016-12-27 11:43:01.014 xcodebuild[17247:761697] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-11758/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/ProjectModel/Capabilities/Xcode3TargetCapabilitiesContext.m:292
Details: Failed to expand identifiers "{(
"group.com.beastbikes.ios"
)}": Error Domain=IDECapabilitiesErrorDomain Code=1 "The operation requires a selected developer portal team." UserInfo={NSLocalizedDescription=The operation requires a selected developer portal team., NSLocalizedRecoverySuggestion=}
Object: <Xcode3TargetCapabilitiesContext: 0x7f9d8dc7f6a0>
Method: -_appIDFeatureStateIncludingEntitlements:
Thread: <NSThread: 0x7f9d8a50f020>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
[11:43:01]: Unable to find any .xccoverage file.
[11:43:01]: Make sure you have enabled 'Gather code coverage' setting on your scheme settings.
[11:43:01]: Alternatively you can provide the full path to your .xccoverage file.
Looking for related GitHub issues on fastlane/fastlane...
Found no similar issues. To create a new issue, please visit:
https://github.com/fastlane/fastlane/issues/new
Run fastlane env
to append the fastlane environment to your issue
Thanx for that noteworthy tool!
Did not find an analog to the xcodebuild
's parameter
-destination 'platform=iOS Simulator,name=iPhone SE,OS=10.2'
Hi amigos! Thanks for this amazing tool!
I'm trying to use it with quite big project. It's a massive xcworkspace
with more than 10 projects and couple dozen app, library, framework and unit test targets.
What I'd like to do is to generate xcov report for all the targets that were unit tested.
The scenario would be:
xccoverage
files in the Logs/Test
directoryIs it possible to run the tool this way? I was also trying to pass path to xccoverage files directly to the tool, didn't work.
Last question - why repo contains only binary for xcov-core
? How are you actually parsing xcoverage files?
A project using xcov cannot install the latest version of fastlane 1.111.0 because of the hard dependency on fastlanecore.
A solution would be to update this dependency:
spec.add_dependency 'fastlane_core', '>= 0.44.0', '< 1.0.0'
same as #38
We're seeing the following error coming up when running the xcov action:
Could not find option for key :configuration. Available keys: workspace, project, scheme, derived_data_path, output_directory, html_report, markdown_report, json_report, minimum_coverage_percentage, ignore_file_path, include_test_targets, slack_url, slack_channel, skip_slack, exclude_targets
The stacktrace indicates that this is happening in https://github.com/nakiostudio/xcov/blob/master/lib/xcov.rb#L25 when it's verifying the options bundle.
This appears to happen when fastlane_core is upgraded to 0.57.0 as an internal dependency of Fastlane.
Do you have any pointers?
Currently files ignored via .xcovignore
are not really ignored — they appear as 0% coverage.
For example:
+-----------------------------------+----+
| xcov Coverage Report |
+-----------------------------------+----+
– snip ✂️ –
| AFNetworking.framework | 0% |
| OMGHTTPURLRQ.framework | 0% |
+-----------------------------------+----+
However, I don't want to see these files at all.
Would be nice if there was a --hide-ignored-files
option to completely remove this irrelevant stuff from the report.
Hi,
it would be nice to be able to get the code coverage from a Fastlane
lane. A quick'n'dirty way to do it can be seen in this gist
But this is just the unfolding of the gem
inside the action
. It could break at any update. A simple way to do it would be for the gem to have the option to be called fastlane style
so that it returns all the infos needed in a result
object.
I'm sorry I won't have time to propose any PR for this. But maybe someone is interested or already working on a similar case.
Hi,
I have installed gem xcov. But when i run the command xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output it gives -bash: xcov: command not found.
Please help.
I really love this gem, unfortunately we use hipchat at my new company, no I am not able to receive those nice notifications anymore. Is it hard, to port the slack messages to hip chat?
Despite of description done in README.md, --only_project_targets
is not available in xcov options.
Run xcov -p MyApp.xcodeproj --only_project_targets
returns :
invalid option : --only_project_targets
I have added this lines in .xcovignore file
- iOSXYZApp/main.m
- Pods
- Applications
- ../Supporting Files
I am using fastlane , adding this in my fastlane file:-
xcov(
workspace: "./iOSXYZApp.xcworkspace",
scheme: ENV['SCHEME'],
output_directory: "xcov_output",
include_test_targets: false
}
But in the coverage report the "main.m" is showing 100% code coverage.
It would be nice if this was redacted.
.log
interface in this commit: fastlane/fastlane@c23f357xcov
action from fastlane no longer works.The --derived_data_path
option is not being respected, in lib/xcov/runner.rb
it attempts to find .xccoverage
files only by looking at the .xcodeproj files, Source
Searching for derived_data_path
and even XCOV_DERIVED_DATA_PATH
in the codebase only yields the setting in lib/xcov/options.rb
This currently interferes with fastlane's setup_jenkins
action which sets the derived data path to a jenkins workspace relative path, so that when running xcov it fails with the following:
ERROR [2016-03-10 00:02:50.02]: Unable to find any .xccoverage file.
ERROR [2016-03-10 00:02:50.02]: Make sure you have enabled 'Gather code coverage' setting on your scheme settings.
ERROR [2016-03-10 00:02:50.02]: Alternatively you can provide the full path to your .xccoverage file.
There is error output here that states that you can provide a full path to the .xccoverage file:
https://github.com/nakiostudio/xcov/blob/b4d00172e7277adae5f28f8fe36c19af33600499/lib/xcov/error_handler.rb#L12
However there is no mechanism to provide a full path to the .xccoverage file that I can see within: manager.rb
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.