appmap 0.66.2 → 0.67.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/appmap/event.rb +4 -2
- data/lib/appmap/handler/net_http.rb +7 -2
- data/lib/appmap/minitest.rb +1 -0
- data/lib/appmap/rspec.rb +1 -0
- data/lib/appmap/version.rb +1 -1
- data/lib/appmap.rb +2 -2
- data/test/fixtures/mocha_mock_app/Gemfile +5 -0
- data/test/fixtures/mocha_mock_app/appmap.yml +5 -0
- data/test/fixtures/mocha_mock_app/lib/sheep.rb +5 -0
- data/test/fixtures/mocha_mock_app/test/sheep_test.rb +18 -0
- data/test/mock_compatibility_test.rb +45 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4209d3f9422b61ba07ca1776597eac220374e8308a303cdf001604c90903dd31
|
4
|
+
data.tar.gz: 55a755af5bd85255ce882633d3089a0ca308d137b15945e0a1fff4d5479c4994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a7ce04424eac8292b0457c99bc3b6f699c0e80a6222450e52f37071e078c2c574c33e8a89249c584412c50da5b26d07f98864f50ecc13e0318da6272fafb879
|
7
|
+
data.tar.gz: 6c8ba9b9a67f09ce662d1bdf0569238537087709cff6f9be2562d50fe06d8ca4199268a2bc3c0d9136dd8a6ab6ff0e66f0d85683b4d3c15e95ba5e10dbcdeb71
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
# [0.67.0](https://github.com/applandinc/appmap-ruby/compare/v0.66.2...v0.67.0) (2021-10-21)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Ensure rack is available, and handle nil HTTP response ([5e81dc4](https://github.com/applandinc/appmap-ruby/commit/5e81dc4310c9b7f2d81c31339f8490639c845f76))
|
7
|
+
* Handle WeakRef ([852ee04](https://github.com/applandinc/appmap-ruby/commit/852ee047880f9d1492be38772ed3f0cc1a670cb5))
|
8
|
+
|
9
|
+
|
10
|
+
### Features
|
11
|
+
|
12
|
+
* APPMAP_AUTOREQUIRE and APPMAP_INITIALIZE env vars to customize loading behavior ([369807e](https://github.com/applandinc/appmap-ruby/commit/369807e4c90243e296b324e70805bd09d0f5fc4a))
|
13
|
+
* Perform GC before running each test ([84c895e](https://github.com/applandinc/appmap-ruby/commit/84c895e95fe8caa270cc1412e239599bfcc1b467))
|
14
|
+
|
1
15
|
## [0.66.2](https://github.com/applandinc/appmap-ruby/compare/v0.66.1...v0.66.2) (2021-10-07)
|
2
16
|
|
3
17
|
|
data/lib/appmap/event.rb
CHANGED
@@ -111,10 +111,12 @@ module AppMap
|
|
111
111
|
rescue NoMethodError
|
112
112
|
begin
|
113
113
|
value.inspect
|
114
|
-
rescue
|
114
|
+
rescue
|
115
115
|
last_resort_string.call
|
116
116
|
end
|
117
|
-
rescue
|
117
|
+
rescue WeakRef::RefError
|
118
|
+
nil
|
119
|
+
rescue
|
118
120
|
last_resort_string.call
|
119
121
|
end
|
120
122
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'appmap/event'
|
4
4
|
require 'appmap/util'
|
5
|
+
require 'rack'
|
5
6
|
|
6
7
|
module AppMap
|
7
8
|
module Handler
|
@@ -60,10 +61,14 @@ module AppMap
|
|
60
61
|
def initialize(response, parent_id, elapsed)
|
61
62
|
super AppMap::Event.next_id_counter, :return, Thread.current.object_id
|
62
63
|
|
63
|
-
|
64
|
+
if response
|
65
|
+
self.status = response.code.to_i
|
66
|
+
self.headers = NetHTTP.copy_headers(response)
|
67
|
+
else
|
68
|
+
self.headers = {}
|
69
|
+
end
|
64
70
|
self.parent_id = parent_id
|
65
71
|
self.elapsed = elapsed
|
66
|
-
self.headers = NetHTTP.copy_headers(response)
|
67
72
|
end
|
68
73
|
|
69
74
|
def to_h
|
data/lib/appmap/minitest.rb
CHANGED
data/lib/appmap/rspec.rb
CHANGED
data/lib/appmap/version.rb
CHANGED
data/lib/appmap.rb
CHANGED
@@ -74,6 +74,6 @@ lambda do
|
|
74
74
|
require 'appmap/depends'
|
75
75
|
end
|
76
76
|
|
77
|
-
end.call
|
77
|
+
end.call unless ENV['APPMAP_AUTOREQUIRE'] == 'false'
|
78
78
|
|
79
|
-
AppMap.initialize_configuration if ENV['APPMAP'] == 'true'
|
79
|
+
AppMap.initialize_configuration if ENV['APPMAP'] == 'true' && ENV['APPMAP_INITIALIZE'] != 'false'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
|
5
|
+
require 'appmap'
|
6
|
+
require 'appmap/minitest' if ENV['APPMAP_AUTOREQUIRE'] == 'false'
|
7
|
+
|
8
|
+
require 'sheep'
|
9
|
+
require 'mocha/minitest'
|
10
|
+
|
11
|
+
class SheepTest < Minitest::Test
|
12
|
+
def test_sheep
|
13
|
+
sheep = mock('sheep')
|
14
|
+
sheep.responds_like(Sheep.new)
|
15
|
+
sheep.expects(:baa).returns('baa')
|
16
|
+
sheep.baa
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'test_helper'
|
5
|
+
|
6
|
+
class MockCompatibilityTest < Minitest::Test
|
7
|
+
def perform_minitest_test(test_name, env = {})
|
8
|
+
Bundler.with_clean_env do
|
9
|
+
Dir.chdir 'test/fixtures/mocha_mock_app' do
|
10
|
+
FileUtils.rm_rf 'tmp'
|
11
|
+
system 'bundle config --local local.appmap ../../..'
|
12
|
+
system 'bundle'
|
13
|
+
system(env.merge({ 'APPMAP' => 'true' }), %(bundle exec ruby -Ilib -Itest test/#{test_name}_test.rb))
|
14
|
+
|
15
|
+
yield
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_expectation
|
21
|
+
perform_minitest_test('sheep') do
|
22
|
+
appmap_file = 'tmp/appmap/minitest/Sheep_sheep.appmap.json'
|
23
|
+
|
24
|
+
assert File.file?(appmap_file), 'appmap output file does not exist'
|
25
|
+
appmap = JSON.parse(File.read(appmap_file))
|
26
|
+
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
27
|
+
assert_includes appmap.keys, 'metadata'
|
28
|
+
metadata = appmap['metadata']
|
29
|
+
assert_equal 'succeeded', metadata['test_status']
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_expectation_without_autorequire
|
34
|
+
perform_minitest_test('sheep', 'APPMAP_AUTOREQUIRE' => 'false') do
|
35
|
+
appmap_file = 'tmp/appmap/minitest/Sheep_sheep.appmap.json'
|
36
|
+
|
37
|
+
assert File.file?(appmap_file), 'appmap output file does not exist'
|
38
|
+
appmap = JSON.parse(File.read(appmap_file))
|
39
|
+
assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
|
40
|
+
assert_includes appmap.keys, 'metadata'
|
41
|
+
metadata = appmap['metadata']
|
42
|
+
assert_equal 'succeeded', metadata['test_status']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
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.
|
4
|
+
version: 0.67.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -3699,6 +3699,10 @@ files:
|
|
3699
3699
|
- test/fixtures/minitest_recorder/appmap.yml
|
3700
3700
|
- test/fixtures/minitest_recorder/lib/hello.rb
|
3701
3701
|
- test/fixtures/minitest_recorder/test/hello_test.rb
|
3702
|
+
- test/fixtures/mocha_mock_app/Gemfile
|
3703
|
+
- test/fixtures/mocha_mock_app/appmap.yml
|
3704
|
+
- test/fixtures/mocha_mock_app/lib/sheep.rb
|
3705
|
+
- test/fixtures/mocha_mock_app/test/sheep_test.rb
|
3702
3706
|
- test/fixtures/openssl_recorder/Gemfile
|
3703
3707
|
- test/fixtures/openssl_recorder/appmap.yml
|
3704
3708
|
- test/fixtures/openssl_recorder/lib/openssl_cert_sign.rb
|
@@ -3715,6 +3719,7 @@ files:
|
|
3715
3719
|
- test/gem_test.rb
|
3716
3720
|
- test/inspect_cli_test.rb
|
3717
3721
|
- test/minitest_test.rb
|
3722
|
+
- test/mock_compatibility_test.rb
|
3718
3723
|
- test/openssl_test.rb
|
3719
3724
|
- test/record_process_test.rb
|
3720
3725
|
- test/rspec_test.rb
|