Skip to content

feat: Emit metadata.recorder.type #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/appmap/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def update_metadata(scenario, base_metadata)
'version' => Gem.loaded_specs['cucumber']&.version&.to_s
}
m['recorder'] = {
'name' => 'cucumber'
'name' => 'cucumber',
'type' => 'tests'
}
end
end
Expand Down
6 changes: 4 additions & 2 deletions lib/appmap/middleware/remote_recording.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def ws_stop_recording(req)

metadata = AppMap.detect_metadata
metadata[:recorder] = {
name: 'remote_recording'
name: 'remote_recording',
type: 'remote'
}

response = JSON.generate \
Expand Down Expand Up @@ -103,7 +104,8 @@ def call(env)
metadata[:name] = appmap_name
metadata[:timestamp] = start_time.to_f
metadata[:recorder] = {
name: 'record_requests'
name: 'rack',
type: 'requests'
}

appmap = {
Expand Down
3 changes: 2 additions & 1 deletion lib/appmap/minitest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def save(name:, class_map:, source_location:, test_status:, exception:, events:)
version: Gem.loaded_specs['minitest']&.version&.to_s
}
m[:recorder] = {
name: 'minitest'
name: 'minitest',
type: 'tests'
}
m[:test_status] = test_status
if exception
Expand Down
3 changes: 2 additions & 1 deletion lib/appmap/record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

metadata = AppMap.detect_metadata
metadata[:recorder] = {
name: 'record_process'
name: 'record_process',
type: 'process'
}

appmap = {
Expand Down
3 changes: 2 additions & 1 deletion lib/appmap/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def save(name:, class_map:, source_location:, test_status:, exception:, events:)
version: Gem.loaded_specs['rspec-core']&.version&.to_s
}
m[:recorder] = {
name: 'rspec'
name: 'rspec',
type: 'tests'
}
m[:test_status] = test_status
if exception
Expand Down
2 changes: 1 addition & 1 deletion lib/appmap/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module AppMap

VERSION = '0.90.1'

APPMAP_FORMAT_VERSION = '1.7.0'
APPMAP_FORMAT_VERSION = '1.9.0'

SUPPORTED_RUBY_VERSIONS = %w[2.5 2.6 2.7 3.0 3.1].freeze
Comment on lines -8 to 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if AppMap is deprecating support for Ruby 2.5 after seeing this change in a different pr. Doesn't need to happen in this pr.


Expand Down
4 changes: 2 additions & 2 deletions test/cucumber_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_cucumber
assert_includes metadata.keys, 'client'
assert_equal({ name: 'appmap', url: AppMap::URL, version: AppMap::VERSION }.stringify_keys, metadata['client'])
assert_includes metadata.keys, 'recorder'
assert_equal({ name: 'cucumber' }.stringify_keys, metadata['recorder'])
assert_equal({ name: 'cucumber', type: 'tests' }.stringify_keys, metadata['recorder'])

assert_includes metadata.keys, 'frameworks'
cucumber = metadata['frameworks'].select {|f| f['name'] == 'cucumber'}
Expand All @@ -62,7 +62,7 @@ def test_cucumber4
assert_includes metadata.keys, 'client'
assert_equal({ name: 'appmap', url: AppMap::URL, version: AppMap::VERSION }.stringify_keys, metadata['client'])
assert_includes metadata.keys, 'recorder'
assert_equal({ name: 'cucumber' }.stringify_keys, metadata['recorder'])
assert_equal({ name: 'cucumber', type: 'tests' }.stringify_keys, metadata['recorder'])

assert_includes metadata.keys, 'frameworks'
cucumber = metadata['frameworks'].select {|f| f['name'] == 'cucumber'}
Expand Down
1 change: 1 addition & 0 deletions test/minitest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def test_hello
metadata = appmap['metadata']
assert_equal 'minitest_recorder', metadata['app']
assert_equal 'minitest', metadata['recorder']['name']
assert_equal 'tests', metadata['recorder']['type']
assert_equal 'ruby', metadata['language']['name']
assert_equal 'Hello hello', metadata['name']
assert_equal 'test/hello_test.rb:9', metadata['source_location']
Expand Down
2 changes: 1 addition & 1 deletion test/rspec_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_record_decorated_rspec
assert_includes metadata.keys, 'client'
assert_equal({ name: 'appmap', url: AppMap::URL, version: AppMap::VERSION }.stringify_keys, metadata['client'])
assert_includes metadata.keys, 'recorder'
assert_equal({ name: 'rspec' }.stringify_keys, metadata['recorder'])
assert_equal({ name: 'rspec', type: 'tests' }.stringify_keys, metadata['recorder'])

assert_includes metadata.keys, 'frameworks'
rspec = metadata['frameworks'].select {|f| f['name'] == 'rspec'}
Expand Down