mutest icon indicating copy to clipboard operation
mutest copied to clipboard

uninitialized constant Parser

Open felixyz opened this issue 8 years ago • 3 comments

This is a very basic question/issue, but I've attempted to get started with mutant/mutest several times over the years and always got stalled on something stupid. Would really appreciate any help to get past this stage.

Tried with both MRI and 2.4.1 and 2.4.0. mutest 0.0.7 parser 2.3.3.1

$ RAILS_ENV=test bundle exec mutest -r ./config/environment --use rspec User                                                                                                            warning: parser/current is loading parser/ruby24, which recognizes
warning: HEAD-compliant syntax, but you are running 2.4.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
/usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/unparser-0.2.5/lib/unparser/emitter/literal/primitive.rb:39: warning: constant ::Fixnum is deprecated
/usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/unparser-0.2.5/lib/unparser/emitter/literal/primitive.rb:40: warning: constant ::Bignum is deprecated
The PGconn, PGresult, and PGError constants are deprecated, and will be
removed as of version 1.0.

You should use PG::Connection, PG::Result, and PG::Error instead, respectively.

Called from /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
bundler: failed to load command: mutest (/usr/local/var/rbenv/versions/2.4.1/bin/mutest)
NameError: uninitialized constant Parser
  /Users/felix/code/jojnts-service/spec/spec_helper.rb:3:in `<top (required)>'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1295:in `block in requires='
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1295:in `each'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1295:in `requires='
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration_options.rb:109:in `block in process_options_into'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration_options.rb:108:in `each'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration_options.rb:108:in `process_options_into'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration_options.rb:21:in `configure'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:105:in `setup'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mutest-rspec-0.0.7/lib/mutest/integration/rspec.rb:44:in `setup'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/memoizable-0.4.2/lib/memoizable/method_builder.rb:117:in `call'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/memoizable-0.4.2/lib/memoizable/method_builder.rb:117:in `block (3 levels) in create_memoized_method'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/memoizable-0.4.2/lib/memoizable/memory.rb:63:in `block (3 levels) in fetch'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/thread_safe-0.3.6/lib/thread_safe/cache.rb:56:in `fetch'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/memoizable-0.4.2/lib/memoizable/memory.rb:62:in `block (2 levels) in fetch'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/memoizable-0.4.2/lib/memoizable/memory.rb:61:in `block in fetch'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/thread_safe-0.3.6/lib/thread_safe/cache.rb:56:in `fetch'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/memoizable-0.4.2/lib/memoizable/memory.rb:60:in `fetch'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/memoizable-0.4.2/lib/memoizable/method_builder.rb:116:in `block (2 levels) in create_memoized_method'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mutest-0.0.7/lib/mutest/env/bootstrap.rb:102:in `infect'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mutest-0.0.7/lib/mutest/env/bootstrap.rb:35:in `initialize'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/adamantium-0.2.0/lib/adamantium/class_methods.rb:17:in `new'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/adamantium-0.2.0/lib/adamantium/class_methods.rb:17:in `new'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/procto-0.0.3/lib/procto.rb:62:in `block in initialize'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mutest-0.0.7/lib/mutest/cli.rb:15:in `run'
  /usr/local/var/rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/mutest-0.0.7/bin/mutest:39:in `<top (required)>'
  /usr/local/var/rbenv/versions/2.4.1/bin/mutest:22:in `load'
  /usr/local/var/rbenv/versions/2.4.1/bin/mutest:22:in `<top (required)>'

felixyz avatar Jun 22 '17 10:06 felixyz

I'm not sure based on this stack trace what is happening. Could you share your spec helper possibly?

backus avatar Jun 25 '17 21:06 backus

@backus Unexciting spec helper (reduced it to almost nothing, got the same error) but I've found out that the presence of another gem triggers the problem, namely oj_mimic_json. If I remove that from my gemfile I can run mutest. If you like, I can try to create a minimal reproduce.

felixyz avatar Jun 26 '17 13:06 felixyz

That is interesting. I wont be able to investigate for a while so if you could find a minimal reproduction then that would be pretty helpful.

backus avatar Jun 26 '17 17:06 backus