diff --git a/test/multiverse/suites/view_component/Envfile b/test/multiverse/suites/view_component/Envfile index a528030153..10100d9ee3 100644 --- a/test/multiverse/suites/view_component/Envfile +++ b/test/multiverse/suites/view_component/Envfile @@ -5,7 +5,8 @@ instrumentation_methods :chain, :prepend VIEW_COMPONENT_VERSIONS = [ - [nil, 2.7] + [nil, 2.7], + ['2.53.0', 2.4] ] def gem_list(view_component_version = nil) diff --git a/test/multiverse/suites/view_component/view_component_instrumentation_test.rb b/test/multiverse/suites/view_component/view_component_instrumentation_test.rb index c35ce988ea..9805313f03 100644 --- a/test/multiverse/suites/view_component/view_component_instrumentation_test.rb +++ b/test/multiverse/suites/view_component/view_component_instrumentation_test.rb @@ -20,10 +20,16 @@ def index end end +class DummyViewComponentInstrumentationClass + include NewRelic::Agent::Instrumentation::ViewComponent +end + class ViewComponentInstrumentationTest < ActionDispatch::IntegrationTest include MultiverseHelpers setup_and_teardown_agent + FAKE_CLASS = DummyViewComponentInstrumentationClass.new + def test_metric_recorded get('/view_components') @@ -37,4 +43,12 @@ def test_records_nothing_if_tracing_disabled assert_metrics_not_recorded('View/view_component/view_component_instrumentation_test.rb/ExampleComponent') end + + def test_metric_path_falsey + assert(FAKE_CLASS.metric_path(nil), 'component') + end + + def test_metric_path_unknown_file_pattern + assert(FAKE_CLASS.metric_path('nothing_to_see_here'), 'unknown') + end end