getappmap / appmap-ruby

AppMap client agent for Ruby
https://appland.org
Other
100 stars 13 forks source link

Bug: appmap breaks tests of "ahoy" rails app #169

Closed ptrdvrk closed 2 years ago

ptrdvrk commented 3 years ago

When running minitest tests with APPMAP=true, the tests break.

Gemfile:

source "https://rubygems.org"

gem 'appmap', :groups => [:development, :test]

gemspec

gem "rails", "~> 6.1.0"
gem "rake"
gem "minitest"
gem "combustion"
gem "sqlite3"
gem "pg"
# gem "mysql2"
# TODO use rubygems when > 7.2.0 is released
gem "mongoid", github: "mongodb/mongoid"
gem "browser", "~> 2.0"
gem "user_agent_parser"

appmap.yml:

---
name: ahoy
packages:
- path: app/controllers
- path: lib

Error log:

# ptrdvrk • ~/work/github/ruby/5mtv/ahoy • master*
‣ APPMAP=true bundle exec rake test
Run options: --seed 2769

# Running:

.......................Traceback (most recent call last):
        20: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:68:in `block in autorun'
        19: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:141:in `run'
        18: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:164:in `__run'
        17: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:164:in `map'
        16: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:164:in `block in __run'
        15: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:326:in `run'
        14: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:354:in `with_info_handler'
        13: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:367:in `on_signal'
        12: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:327:in `block in run'
        11: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:327:in `each'
        10: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:328:in `block (2 levels) in run'
         9: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:341:in `run_one_method'
         8: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/minitest-5.14.4/lib/minitest.rb:1029:in `run_one_method'
         7: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/appmap-0.58.0/lib/appmap/minitest.rb:148:in `run'
         6: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/appmap-0.58.0/lib/appmap/minitest.rb:81:in `end_test'
         5: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/appmap-0.58.0/lib/appmap/minitest.rb:48:in `finish'
         4: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/appmap-0.58.0/lib/appmap/minitest.rb:122:in `save'
         3: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/2.7.0/json/common.rb:224:in `generate'
         2: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/appmap-0.58.0/lib/appmap/hook/method.rb:77:in `block in activate'
         1: from /Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/appmap-0.58.0/lib/appmap/hook/method.rb:62:in `block (2 levels) in activate'
/Users/ptrdvrk/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/appmap-0.58.0/lib/appmap/hook/method.rb:62:in `generate': source sequence is illegal/malformed utf-8 (JSON::GeneratorError)
rake aborted!
Command failed with status (1)
/Users/ptrdvrk/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
/Users/ptrdvrk/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)
✖ 1
kgilpin commented 2 years ago

Presumed fixed.