Comments (8)
Hi @stevenreinisch. Thanks for the feedback but that report is submitted to Fastlane, not to me. Could you please give me more details? logs?
Thanks 👍
from xcov.
Hi,
I ran scan
on my project and then xcov
. It crashed with the following stack trace:
.rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb:23:in `/': [!] divided by 0 (ZeroDivisionError)
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb:23:in `average_coverage'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb:12:in `initialize'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb:49:in `new'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb:49:in `map'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/runner.rb:53:in `generate_xcov_report'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/runner.rb:14:in `run'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/manager.rb:9:in `work'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/commands_generator.rb:41:in `block (2 levels) in run'
from .rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
from .rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/command.rb:178:in `call'
from .rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/command.rb:153:in `run'
from .rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/runner.rb:428:in `run_active_command'
from .rvm/gems/ruby-2.2.1/gems/fastlane_core-0.36.6/lib/fastlane_core/ui/fastlane_runner.rb:23:in `run!'
from .rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/delegates.rb:15:in `run!'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/commands_generator.rb:47:in `run'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/commands_generator.rb:15:in `start'
from .rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/bin/xcov:6:in `<top (required)>'
from .rvm/rubies/ruby-2.2.1/bin/xcov:23:in `load'
from .rvm/rubies/ruby-2.2.1/bin/xcov:23:in `<main>'
from .rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
from .rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
This is the crash report:
{
"event_id": "accab654b3f7ad49c770c0b52183f0da",
"message": "ZeroDivisionError: divided by 0",
"timestamp": "2016-03-02T13:00:07",
"time_spent": null,
"level": 40,
"project": null,
"platform": "ruby",
"logger": "",
"culprit": "xcov/model/report.rb in / at line 23",
"server_name": "stevens-macbook-pro.local",
"release": "cc2d9b3",
"modules": {
"actionmailer": "4.2.4",
"actionpack": "4.2.4",
"actionview": "4.2.4",
"activejob": "4.2.4",
"activemodel": "4.2.4",
"activerecord": "4.2.4",
"activesupport": "4.2.4",
"addressable": "2.3.8",
"arel": "6.0.3",
"autoparse": "0.3.3",
"babosa": "1.0.2",
"bigdecimal": "1.2.6",
"binding_of_caller": "0.7.2",
"builder": "3.2.2",
"bundler": "1.11.2",
"bundler-unload": "1.0.2",
"byebug": "8.2.1",
"cert": "1.2.8",
"chartkick": "1.4.1",
"claide": "0.9.1",
"coderay": "1.1.0",
"coffee-rails": "4.1.0",
"coffee-script": "2.4.1",
"coffee-script-source": "1.10.0",
"colored": "1.2",
"commander": "4.3.5",
"concurrent-ruby": "1.0.0",
"credentials_manager": "0.14.0",
"debug_inspector": "0.0.2",
"deliver": "1.8.1",
"diff-lcs": "1.2.5",
"domain_name": "0.5.25",
"dotenv": "2.1.0",
"erubis": "2.7.0",
"excon": "0.45.4",
"execjs": "2.6.0",
"executable-hooks": "1.3.2",
"extlib": "0.9.16",
"faraday": "0.9.2",
"faraday-cookie_jar": "0.0.6",
"faraday_middleware": "0.10.0",
"faraday_middleware-multi_json": "0.0.6",
"fastimage": "1.6.8",
"fastlane": "1.52.0",
"fastlane_core": "0.35.1",
"frameit": "2.4.1",
"gem-wrappers": "1.2.7",
"globalid": "0.3.6",
"google-api-client": "0.8.6",
"googleauth": "0.5.1",
"gym": "1.4.0",
"highline": "1.7.8",
"http-cookie": "1.0.2",
"httpclient": "2.7.1",
"hurley": "0.2",
"i18n": "0.7.0",
"io-console": "0.4.3",
"jbuilder": "2.3.2",
"jquery-rails": "4.0.5",
"json": "1.8.1",
"jwt": "1.5.2",
"krausefx-shenzhen": "0.14.7",
"launchy": "2.4.3",
"little-plugger": "1.1.4",
"logging": "2.0.0",
"loofah": "2.0.3",
"mail": "2.6.3",
"match": "0.2.5",
"memoist": "0.14.0",
"method_source": "0.8.2",
"mime-types": "2.99",
"mini_magick": "4.0.4",
"mini_portile": "0.6.2",
"mini_portile2": "2.0.0",
"minitest": "5.8.3",
"multi_json": "1.11.2",
"multi_xml": "0.5.5",
"multipart-post": "2.0.0",
"net-sftp": "2.1.2",
"net-ssh": "3.0.2",
"nokogiri": "1.6.6.4",
"oauth2": "1.0.0",
"os": "0.9.6",
"pem": "1.1.1",
"pg": "0.18.4",
"pilot": "1.2.1",
"plist": "3.1.0",
"produce": "1.1.1",
"pry": "0.10.3",
"psych": "2.0.8",
"rack": "1.6.4",
"rack-test": "0.6.3",
"rails": "4.2.4",
"rails-deprecated_sanitizer": "1.0.3",
"rails-dom-testing": "1.0.7",
"rails-html-sanitizer": "1.0.2",
"railties": "4.2.4",
"rake": "10.4.2",
"rdoc": "4.2.0",
"redis": "3.2.1",
"representable": "2.3.0",
"retriable": "1.4.1",
"rouge": "1.10.1",
"rspec-core": "3.4.1",
"rspec-expectations": "3.4.0",
"rspec-mocks": "3.4.0",
"rspec-rails": "3.4.0",
"rspec-support": "3.4.1",
"rubygems-bundler": "1.4.4",
"rubyzip": "1.1.7",
"rvm": "1.11.3.9",
"sass": "3.4.19",
"sass-rails": "5.0.4",
"scan": "0.4.1",
"screengrab": "0.2.0",
"sdoc": "0.4.1",
"security": "0.1.3",
"sentry-raven": "0.15.3",
"sigh": "1.2.2",
"signet": "0.7.2",
"slack-notifier": "1.5.1",
"slop": "3.6.0",
"snapshot": "1.4.4",
"spaceship": "0.19.3",
"spring": "1.4.4",
"sprockets": "3.4.1",
"sprockets-rails": "2.3.3",
"supply": "0.3.0",
"terminal-notifier": "1.6.3",
"terminal-table": "1.4.5",
"thor": "0.19.1",
"thread_safe": "0.3.5",
"tilt": "2.0.1",
"turbolinks": "2.5.3",
"tzinfo": "1.2.2",
"uber": "0.0.15",
"uglifier": "2.7.2",
"unf": "0.1.4",
"unf_ext": "0.0.7.1",
"web-console": "2.2.1",
"xcode-install": "1.0.1",
"xcodeproj": "0.28.2",
"xcov": "0.2",
"xcpretty": "0.2.2",
"xcpretty-travis-formatter": "0.0.4"
},
"extra": {
},
"tags": {
},
"user": {
},
"exception": {
"values": [
{
"type": "ZeroDivisionError",
"value": "divided by 0",
"module": "",
"stacktrace": {
"frames": [
{
"pre_context": [
" warn \"unable to load executable-hooks/hooks\" if ENV.key?('ExecutableHooks_DEBUG')\n",
"end\n",
"\n"
],
"post_context": [
null,
null,
null
],
"abs_path": ".rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks",
"function": "<main>",
"lineno": 15,
"in_app": false,
"context_line": "eval File.read($0), binding, $0\n",
"project_root": null,
"filename": ".rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks"
},
{
"pre_context": [
" warn \"unable to load executable-hooks/hooks\" if ENV.key?('ExecutableHooks_DEBUG')\n",
"end\n",
"\n"
],
"post_context": [
null,
null,
null
],
"abs_path": ".rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks",
"function": "eval",
"lineno": 15,
"in_app": false,
"context_line": "eval File.read($0), binding, $0\n",
"project_root": null,
"filename": ".rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks"
},
{
"pre_context": [
"end\n",
"\n",
"gem 'xcov', version\n"
],
"post_context": [
null,
null,
null
],
"abs_path": ".rvm/rubies/ruby-2.2.1/bin/xcov",
"function": "<main>",
"lineno": 23,
"in_app": false,
"context_line": "load Gem.bin_path('xcov', 'xcov', version)\n",
"project_root": null,
"filename": ".rvm/rubies/ruby-2.2.1/bin/xcov"
},
{
"pre_context": [
"end\n",
"\n",
"gem 'xcov', version\n"
],
"post_context": [
null,
null,
null
],
"abs_path": ".rvm/rubies/ruby-2.2.1/bin/xcov",
"function": "load",
"lineno": 23,
"in_app": false,
"context_line": "load Gem.bin_path('xcov', 'xcov', version)\n",
"project_root": null,
"filename": ".rvm/rubies/ruby-2.2.1/bin/xcov"
},
{
"pre_context": [
"\n",
"require \"xcov\"\n",
"require \"xcov/commands_generator\"\n"
],
"post_context": [
null,
null,
null
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/bin/xcov",
"function": "<top (required)>",
"lineno": 6,
"in_app": false,
"context_line": "Xcov::CommandsGenerator.start\n",
"project_root": null,
"filename": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/bin/xcov"
},
{
"pre_context": [
"\n",
" def self.start\n",
" FastlaneCore::UpdateChecker.start_looking_for_update(\"xcov\")\n"
],
"post_context": [
" ensure\n",
" FastlaneCore::UpdateChecker.show_update_status(\"xcov\", Xcov::VERSION)\n",
" end\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/commands_generator.rb",
"function": "start",
"lineno": 15,
"in_app": false,
"context_line": " new.run\n",
"project_root": null,
"filename": "xcov/commands_generator.rb"
},
{
"pre_context": [
"\n",
" default_command :report\n",
"\n"
],
"post_context": [
" end\n",
"\n",
" end\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/commands_generator.rb",
"function": "run",
"lineno": 47,
"in_app": false,
"context_line": " run!\n",
"project_root": null,
"filename": "xcov/commands_generator.rb"
},
{
"pre_context": [
" never_trace!\n",
" ).each do |meth|\n",
" eval <<-END, binding, __FILE__, __LINE__\n"
],
"post_context": [
" ::Commander::Runner.instance.#{meth}(*args, &block)\n",
" end\n",
" END\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/delegates.rb",
"function": "run!",
"lineno": 15,
"in_app": false,
"context_line": " def #{meth}(*args, &block)\n",
"project_root": null,
"filename": "commander/delegates.rb"
},
{
"pre_context": [
" remove_global_options options, @args\n",
"\n",
" begin\n"
],
"post_context": [
" rescue InvalidCommandError => e\n",
" abort \"#{e}. Use --help for more information\"\n",
" rescue Interrupt => ex\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1/gems/fastlane_core-0.36.6/lib/fastlane_core/ui/fastlane_runner.rb",
"function": "run!",
"lineno": 23,
"in_app": false,
"context_line": " run_active_command\n",
"project_root": null,
"filename": "fastlane_core/ui/fastlane_runner.rb"
},
{
"pre_context": [
" if alias? command_name_from_args\n",
" active_command.run(*(@aliases[command_name_from_args.to_s] + args_without_command_name))\n",
" else\n"
],
"post_context": [
" end\n",
" end\n",
"\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/runner.rb",
"function": "run_active_command",
"lineno": 428,
"in_app": false,
"context_line": " active_command.run(*args_without_command_name)\n",
"project_root": null,
"filename": "commander/runner.rb"
},
{
"pre_context": [
" #\n",
"\n",
" def run(*args)\n"
],
"post_context": [
" end\n",
"\n",
" #:stopdoc:\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/command.rb",
"function": "run",
"lineno": 153,
"in_app": false,
"context_line": " call parse_options_and_call_procs(*args)\n",
"project_root": null,
"filename": "commander/command.rb"
},
{
"pre_context": [
" meth = @when_called.shift || :call\n",
" options = proxy_option_struct\n",
" case object\n"
],
"post_context": [
" when Class then meth != :call ? object.new.send(meth, args, options) : object.new(args, options)\n",
" else object.send(meth, args, options) if object\n",
" end\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/command.rb",
"function": "call",
"lineno": 178,
"in_app": false,
"context_line": " when Proc then object.call(args, options)\n",
"project_root": null,
"filename": "commander/command.rb"
},
{
"pre_context": [
" meth = @when_called.shift || :call\n",
" options = proxy_option_struct\n",
" case object\n"
],
"post_context": [
" when Class then meth != :call ? object.new.send(meth, args, options) : object.new(args, options)\n",
" else object.send(meth, args, options) if object\n",
" end\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/commander-4.3.5/lib/commander/command.rb",
"function": "call",
"lineno": 178,
"in_app": false,
"context_line": " when Proc then object.call(args, options)\n",
"project_root": null,
"filename": "commander/command.rb"
},
{
"pre_context": [
" c.description = Xcov::DESCRIPTION\n",
" c.action do |_args, options|\n",
" config = FastlaneCore::Configuration.create(Xcov::Options.available_options, convert_options(options))\n"
],
"post_context": [
" end\n",
" end\n",
"\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/commands_generator.rb",
"function": "block (2 levels) in run",
"lineno": 41,
"in_app": false,
"context_line": " Xcov::Manager.new.work(config)\n",
"project_root": null,
"filename": "xcov/commands_generator.rb"
},
{
"pre_context": [
" def work(options)\n",
" Xcov.config = options\n",
" FastlaneCore::PrintTable.print_values(config: options, hide_keys: [:slack_url], title: \"Summary for xCov #{Xcov::VERSION}\")\n"
],
"post_context": [
" end\n",
"\n",
" end\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/manager.rb",
"function": "work",
"lineno": 9,
"in_app": false,
"context_line": " Runner.new.run\n",
"project_root": null,
"filename": "xcov/manager.rb"
},
{
"pre_context": [
"\n",
" def run\n",
" report_json = parse_xccoverage\n"
],
"post_context": [
" end\n",
"\n",
" def parse_xccoverage\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/runner.rb",
"function": "run",
"lineno": 14,
"in_app": false,
"context_line": " generate_xcov_report(report_json)\n",
"project_root": null,
"filename": "xcov/runner.rb"
},
{
"pre_context": [
" end\n",
"\n",
" # Convert report to xCov model objects\n"
],
"post_context": [
"\n",
" # Create HTML report\n",
" File.open(File.join(output_path, \"index.html\"), \"wb\") do |file|\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/runner.rb",
"function": "generate_xcov_report",
"lineno": 53,
"in_app": false,
"context_line": " report = Report.map(report_json)\n",
"project_root": null,
"filename": "xcov/runner.rb"
},
{
"pre_context": [
" .select { |target| !target[\"name\"].include?(\".xctest\") }\n",
" .map { |target| Target.map(target)}\n",
"\n"
],
"post_context": [
" end\n",
"\n",
" end\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb",
"function": "map",
"lineno": 49,
"in_app": false,
"context_line": " Report.new(targets)\n",
"project_root": null,
"filename": "xcov/model/report.rb"
},
{
"pre_context": [
" .select { |target| !target[\"name\"].include?(\".xctest\") }\n",
" .map { |target| Target.map(target)}\n",
"\n"
],
"post_context": [
" end\n",
"\n",
" end\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb",
"function": "new",
"lineno": 49,
"in_app": false,
"context_line": " Report.new(targets)\n",
"project_root": null,
"filename": "xcov/model/report.rb"
},
{
"pre_context": [
"\n",
" def initialize (targets)\n",
" @targets = targets\n"
],
"post_context": [
" @displayable_coverage = self.create_displayable_coverage\n",
" @coverage_color = self.create_coverage_color\n",
" @summary = self.create_summary\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb",
"function": "initialize",
"lineno": 12,
"in_app": false,
"context_line": " @coverage = average_coverage(targets)\n",
"project_root": null,
"filename": "xcov/model/report.rb"
},
{
"pre_context": [
" targets.each do |target|\n",
" coverage = coverage + target.coverage\n",
" end\n"
],
"post_context": [
" end\n",
"\n",
" def print_description\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb",
"function": "average_coverage",
"lineno": 23,
"in_app": false,
"context_line": " coverage / targets.count\n",
"project_root": null,
"filename": "xcov/model/report.rb"
},
{
"pre_context": [
" targets.each do |target|\n",
" coverage = coverage + target.coverage\n",
" end\n"
],
"post_context": [
" end\n",
"\n",
" def print_description\n"
],
"abs_path": ".rvm/gems/ruby-2.2.1@global/gems/xcov-0.2/lib/xcov/model/report.rb",
"function": "/",
"lineno": 23,
"in_app": false,
"context_line": " coverage / targets.count\n",
"project_root": null,
"filename": "xcov/model/report.rb"
}
]
}
}
]
}
}
Looking at the code, I guess that there are no "targets" here: https://github.com/nakiostudio/xcov/blob/master/lib/xcov/model/report.rb#L45
I have a test target in my project. Why are there none found my project? My test target contains a whitespace in its name.
Thanks,
Steven
from xcov.
Hi again @stevenreinisch. I think I know what's the problem, I will release a hot-fix asap. About your particular case the target name shouldn't matter but I will dig into that. Thanks for reporting 👍 .
from xcov.
Thanks man!
from xcov.
Hi @stevenreinisch 👋
I've just released the version 0.4 fixing this problem and enabling the coverage reports for test targets. To do so you just need to add the include_test_targets
flag when launching xcov. Example:
xcov -w LystSDK.xcworkspace -s LystSDK -o xcov_output --include_test_targets
It'd be great if you can confirm whether this update fixes your problems.
Thank you!
from xcov.
Hi @nakiostudio,
the 0.4 fixes the issue. But :), I had to remove all DerivedData. If not, xcov took an older .xccoverage file - not the most recent one.
Thanks for your efforts!
from xcov.
I will look into that @stevenreinisch. Thanks!
from xcov.
Hi @stevenreinisch. I've released the version 0.5 which sorts out the problem picking the right .xccoverage
file 👍
from xcov.
Related Issues (20)
- [!] Could not find option 'workspace' in the list of available options: HOT 2
- Reports 0% Code Coverage with Xcode 12.5
- Exclude subset of ignored files in .xcovignore HOT 1
- xccov_file_direct_path cannot treat with multiple files
- Missing `clean: true` to delete the existing code coverage data HOT 3
- Parsing Coverage Data for Swift Packages HOT 1
- Invalid coverage report for SPM with dependencies HOT 2
- Missing git information when uploading to coveralls
- Could not find option 'xccov_file_direct_path' in the list of available options HOT 1
- Modernize HTML templates
- Fix root directory when opening files
- How can we ignore `Swift Package Dependencies` HOT 4
- Bad CPU type in executable HOT 6
- .xcovignore file not working HOT 1
- Target with no valid files is considered as having 0% coverage
- Xcov 1.8.1 : Xcov not able to find ignore file path HOT 4
- Include files (opposite of ignore)
- `PBXProject` attempted to initialize an object with unknown ISA `XCLocalSwiftPackageReference`
- "Error occured while exporting xccovreport from xcresult" when "xcov_report" folder already exists HOT 1
- When `minimum_coverage_percentage` set to `100.0` xcov fails even when actual code coverage is `100.00%`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcov.