appmap 0.48.0 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dockerignore +0 -1
- data/CHANGELOG.md +8 -0
- data/lib/appmap/event.rb +1 -1
- data/lib/appmap/minitest.rb +1 -1
- data/lib/appmap/rspec.rb +1 -1
- data/lib/appmap/util.rb +3 -1
- data/lib/appmap/version.rb +1 -1
- data/spec/fixtures/hook/exception_method.rb +6 -0
- data/spec/hook_spec.rb +33 -1
- data/test/bundle_vendor_test.rb +35 -0
- data/test/fixtures/bundle_vendor_app/Gemfile +8 -0
- data/test/fixtures/bundle_vendor_app/appmap.yml +4 -0
- data/test/fixtures/bundle_vendor_app/cli.rb +54 -0
- data/test/gem_test.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 698da91c88a89867584e3d78e10974a4a2f8d726636d60366c214be9e3ddbf97
|
4
|
+
data.tar.gz: eee0b62c442eecc5cf978960128c0b19ff2ebdc393770d8cefc820c82a451d4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77ae4b055912a7bd6f62f32bb2db7d3684d614453fb82bb7d8f53496181919609ca2af0a65906ca36f1f28aaf28e06c64d6f5e6326b8f384f4c1206c22af559a
|
7
|
+
data.tar.gz: a72831c1908beb0130b4797ea5455b976677caec810edcdf0009b9be609ba6510a59873b66ca4df5406fe8f3e5aea995d8dabc983573517adc67fdf86cad822a
|
data/.dockerignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.48.1](https://github.com/applandinc/appmap-ruby/compare/v0.48.0...v0.48.1) (2021-05-25)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Account for bundle path when normalizing source path ([095c278](https://github.com/applandinc/appmap-ruby/commit/095c27818fc8ae8dfa39b30516d37c6dfd642d9c))
|
7
|
+
* Scan exception messages for non-UTF8 characters ([3dcaeae](https://github.com/applandinc/appmap-ruby/commit/3dcaeae44da5e40e432eda41caf5b9ebff5bea12))
|
8
|
+
|
1
9
|
# [0.48.0](https://github.com/applandinc/appmap-ruby/compare/v0.47.1...v0.48.0) (2021-05-19)
|
2
10
|
|
3
11
|
|
data/lib/appmap/event.rb
CHANGED
@@ -213,7 +213,7 @@ module AppMap
|
|
213
213
|
exception_backtrace = next_exception.backtrace_locations.try(:[], 0)
|
214
214
|
exceptions << {
|
215
215
|
class: best_class_name(next_exception),
|
216
|
-
message: next_exception.message,
|
216
|
+
message: display_string(next_exception.message),
|
217
217
|
object_id: next_exception.__id__,
|
218
218
|
path: exception_backtrace&.path,
|
219
219
|
lineno: exception_backtrace&.lineno
|
data/lib/appmap/minitest.rb
CHANGED
data/lib/appmap/rspec.rb
CHANGED
data/lib/appmap/util.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'bundler'
|
4
|
+
|
3
5
|
module AppMap
|
4
6
|
module Util
|
5
7
|
class << self
|
@@ -94,7 +96,7 @@ module AppMap
|
|
94
96
|
end
|
95
97
|
|
96
98
|
def normalize_path(path)
|
97
|
-
if path.index(Dir.pwd) == 0
|
99
|
+
if path.index(Dir.pwd) == 0 && !path.index(Bundler.bundle_path.to_s)
|
98
100
|
path[Dir.pwd.length + 1..-1]
|
99
101
|
else
|
100
102
|
path
|
data/lib/appmap/version.rb
CHANGED
@@ -53,3 +53,9 @@ class ToSRaises
|
|
53
53
|
"hello"
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
class ExceptionMethod
|
58
|
+
def raise_illegal_utf8_message
|
59
|
+
raise "809: unexpected token at 'x\x9C\xED=\x8Bv\xD3ƶ\xBF2\xB8]\xC5\xE9qdI\x96eǫ4\xA4h΅\x84\xE5z\x96\xAA\xD8\xE3\xE3D\xB2\xE4J2\x90E\xF8\xF7\xBB\xF7\xCC\xE81\x92\xE2\x88ā'"
|
60
|
+
end
|
61
|
+
end
|
data/spec/hook_spec.rb
CHANGED
@@ -583,7 +583,7 @@ describe 'AppMap class Hooking', docker: false do
|
|
583
583
|
end
|
584
584
|
end
|
585
585
|
|
586
|
-
it '
|
586
|
+
it 'reports exceptions' do
|
587
587
|
events_yaml = <<~YAML
|
588
588
|
---
|
589
589
|
- :id: 1
|
@@ -615,6 +615,38 @@ describe 'AppMap class Hooking', docker: false do
|
|
615
615
|
end
|
616
616
|
end
|
617
617
|
|
618
|
+
it 'sanitizes exception messages' do
|
619
|
+
events_yaml = <<~YAML
|
620
|
+
---
|
621
|
+
- :id: 1
|
622
|
+
:event: :call
|
623
|
+
:defined_class: ExceptionMethod
|
624
|
+
:method_id: raise_illegal_utf8_message
|
625
|
+
:path: spec/fixtures/hook/exception_method.rb
|
626
|
+
:lineno: 58
|
627
|
+
:static: false
|
628
|
+
:parameters: []
|
629
|
+
:receiver:
|
630
|
+
:class: ExceptionMethod
|
631
|
+
:value: Exception Method fixture
|
632
|
+
- :id: 2
|
633
|
+
:event: :return
|
634
|
+
:parent_id: 1
|
635
|
+
:exceptions:
|
636
|
+
- :class: RuntimeError
|
637
|
+
:message: '809: unexpected token at ''x__=_v_ƶ_2_]__qdI_eǫ4_h΅__z_____D__J2_E______1__ā'''
|
638
|
+
:path: spec/fixtures/hook/exception_method.rb
|
639
|
+
:lineno: 59
|
640
|
+
YAML
|
641
|
+
test_hook_behavior 'spec/fixtures/hook/exception_method.rb', events_yaml do
|
642
|
+
begin
|
643
|
+
ExceptionMethod.new.raise_illegal_utf8_message
|
644
|
+
rescue
|
645
|
+
# don't let the exception fail the test
|
646
|
+
end
|
647
|
+
end
|
648
|
+
end
|
649
|
+
|
618
650
|
context 'string conversions works for the receiver when' do
|
619
651
|
|
620
652
|
it 'is missing #to_s' do
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'test_helper'
|
5
|
+
require 'English'
|
6
|
+
|
7
|
+
class BundleVendorTest < Minitest::Test
|
8
|
+
def perform_bundle_vendor_app(test_name)
|
9
|
+
Bundler.with_clean_env do
|
10
|
+
Dir.chdir 'test/fixtures/bundle_vendor_app' do
|
11
|
+
FileUtils.rm_rf 'tmp'
|
12
|
+
FileUtils.mkdir_p 'tmp'
|
13
|
+
system 'bundle config --local local.appmap ../../..'
|
14
|
+
system 'bundle'
|
15
|
+
system(%(bundle exec ruby -Ilib -Itest cli.rb add foobar))
|
16
|
+
system({ 'APPMAP' => 'true' }, %(bundle exec ruby -Ilib -Itest cli.rb list))
|
17
|
+
|
18
|
+
yield
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_record_gem
|
24
|
+
perform_bundle_vendor_app 'parser' do
|
25
|
+
appmap_file = 'tmp/bundle_vendor_app.appmap.json'
|
26
|
+
appmap = JSON.parse(File.read(appmap_file))
|
27
|
+
assert appmap['classMap'].find { |co| co['name'] == 'gli' }
|
28
|
+
assert appmap['events'].find do |e|
|
29
|
+
e['event'] == 'call' &&
|
30
|
+
e['defined_class'] = 'Hacer::Todolist' &&
|
31
|
+
e['method_id'] == 'list'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'appmap'
|
3
|
+
require 'gli'
|
4
|
+
require 'hacer'
|
5
|
+
|
6
|
+
class App
|
7
|
+
extend GLI::App
|
8
|
+
|
9
|
+
program_desc 'A simple todo list'
|
10
|
+
|
11
|
+
flag [:t,:tasklist], :default_value => File.join(ENV['HOME'],'.todolist')
|
12
|
+
|
13
|
+
pre do |global_options,command,options,args|
|
14
|
+
$todo_list = Hacer::Todolist.new(global_options[:tasklist])
|
15
|
+
end
|
16
|
+
|
17
|
+
command :add do |c|
|
18
|
+
c.action do |global_options,options,args|
|
19
|
+
$todo_list.create(args)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
command :list do |c|
|
24
|
+
c.action do
|
25
|
+
$todo_list.list.each do |todo|
|
26
|
+
printf("%5d - %s\n",todo.todo_id,todo.text)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
command :done do |c|
|
32
|
+
c.action do |global_options,options,args|
|
33
|
+
id = args.shift.to_i
|
34
|
+
$todo_list.list.each do |todo|
|
35
|
+
$todo_list.complete(todo) if todo.todo_id == id
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
exit_status = nil
|
42
|
+
invoke = -> { exit_status = App.run(ARGV) }
|
43
|
+
do_appmap = -> { ENV['APPMAP'] == 'true' }
|
44
|
+
|
45
|
+
if do_appmap.()
|
46
|
+
appmap = AppMap.record do
|
47
|
+
invoke.()
|
48
|
+
end
|
49
|
+
File.write('tmp/bundle_vendor_app.appmap.json', JSON.pretty_generate(appmap))
|
50
|
+
else
|
51
|
+
invoke.()
|
52
|
+
end
|
53
|
+
exit exit_status
|
54
|
+
|
data/test/gem_test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.48.
|
4
|
+
version: 0.48.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -557,9 +557,13 @@ files:
|
|
557
557
|
- spec/remote_recording_spec.rb
|
558
558
|
- spec/spec_helper.rb
|
559
559
|
- spec/util_spec.rb
|
560
|
+
- test/bundle_vendor_test.rb
|
560
561
|
- test/cucumber_test.rb
|
561
562
|
- test/expectations/openssl_test_key_sign1.json
|
562
563
|
- test/expectations/openssl_test_key_sign2.json
|
564
|
+
- test/fixtures/bundle_vendor_app/Gemfile
|
565
|
+
- test/fixtures/bundle_vendor_app/appmap.yml
|
566
|
+
- test/fixtures/bundle_vendor_app/cli.rb
|
563
567
|
- test/fixtures/cli_record_test/appmap.yml
|
564
568
|
- test/fixtures/cli_record_test/lib/cli_record_test/main.rb
|
565
569
|
- test/fixtures/cucumber4_recorder/Gemfile
|