grodowski / undercover

undercover warns about methods, classes and blocks that were changed without tests, to help you easily find untested code and reduce the number of bugs. It does so by analysing data from git diffs, code structure and SimpleCov coverage reports

Home Page:https://undercover-ci.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not parse the whole project dir with imagen (perf + get rid of utf-8 parser errors)

grodowski opened this issue ยท comments

  • bundle install --deployment installs to ./vendor/bundle
  • undercover does not skip this directory while parsing the project

A reasonable solution might be to change the parsing strategy to explicitly parse individual files referenced in Changeset and LcovParser while building the cov report. This is also good for performance which is terrible ATM!

$ git fetch origin master && undercover --compare origin/master
From https://github.com/grodowski/undercover
 * branch            master     -> FETCH_HEAD
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_parser.rb:5306:1-5307:0: error: literal contains escape sequences incompatible with UTF-8
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_parser.rb:5306:          \xd0\xd2\xcf\xd7\xc5\xd2\xcb\xc1 = 42
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_parser.rb:5306: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_parser.rb:5307:          puts \xd0\xd2\xcf\xd7\xc5\xd2\xcb\xc1}.b,
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_parser.rb:5307:                                                   
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_parser.rb: literal contains escape sequences incompatible with UTF-8 literal contains escape sequences incompatible with UTF-8
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_source_buffer.rb:44:9: error: literal contains escape sequences incompatible with UTF-8
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_source_buffer.rb:44:         "# \xf9"
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_source_buffer.rb:44:         ^~~~~~~~
./vendor/bundle/ruby/2.4.0/gems/parser-2.5.1.0/test/test_source_buffer.rb: literal contains escape sequences incompatible with UTF-8 literal contains escape sequences incompatible with UTF-8
undercover: ๐Ÿ‘ฎโ€โ™‚๏ธ some methods have no test coverage! Please add specs for methods listed below
๐Ÿšจ 1) node `untested` type: Imagen::Node::IMethod,
      loc: lib/undercover/formatter.rb:25:31, coverage: 0.0%
25:     def untested hits: n/a
26:       if 'lol'.nil? hits: 0
27:         puts 'wow' hits: 0
28:         exit 8 hits: 0
29:       end hits: n/a
30:       0 hits: 0
31:     end hits: n/a
๐Ÿšจ 2) node `success` type: Imagen::Node::IMethod,
      loc: lib/undercover/formatter.rb:33:40, coverage: 50.0%
33:     def success hits: n/a
34:       if 'lol'.nil? hits: 4
35:         puts 'wow' hits: 0
36:         puts 'blah' hits: 0
37:       end hits: n/a
38:       "#{Rainbow('undercover').bold.green}: โœ… No coverage" \ hits: 4
39:       ' is missing in latest changes' hits: n/a
40:     end hits: n/a
๐Ÿšจ 3) node `initialize` type: Imagen::Node::IMethod,
      loc: lib/undercover/lcov_parser.rb:47:51, coverage: 0.0%
47:     def initialize(test) hits: n/a
48:       @test = test hits: 0
49:       @baz = 'bar' hits: 0
50:       @foo = 'bacon' hits: 0
51:     end hits: n/a
Undercover finished in 36.06677220900019ms
The command "git fetch origin master && undercover --compare origin/master" exited with 1.