Skip to content

Commit

Permalink
Merge pull request #2552 from newrelic/fix-unused-variable-warnings
Browse files Browse the repository at this point in the history
Fix unused variable warnings in unit tests
  • Loading branch information
kaylareopelle committed Apr 12, 2024
2 parents 30b85b9 + 4c5db6e commit 47b4f48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/new_relic/agent/llm/feedback_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_record_llm_feedback_event_records_optional_attributes
NewRelic::Agent.record_llm_feedback_event(trace_id: @trace_id, rating: 5,
category: 'Helpful', message: 'Looks good!', metadata: {'pop' => 'tart', 'toaster' => 'strudel'})
_, events = NewRelic::Agent.agent.custom_event_aggregator.harvest!
type, attributes = events[0]
_, attributes = events[0]

assert_equal 'Helpful', attributes['category']
assert_equal 'Looks good!', attributes['message']
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_record_llm_feedback_event_requires_distributed_tracing
in_transaction do
NewRelic::Agent.record_llm_feedback_event(trace_id: @trace_id, rating: 5)
_, events = NewRelic::Agent.agent.custom_event_aggregator.harvest!
type, attributes = events[0]
_, attributes = events[0]

assert_nil attributes
end
Expand Down
2 changes: 1 addition & 1 deletion test/new_relic/agent/serverless_handler_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ def test_custom_attributes_arent_supported_when_serverless
skip_unless_minitest5_or_above

attrs = {cool_id: 'James', server: 'less', current_time: Time.now.to_s}
attribute_set_attempted = false
tl_current_mock = Minitest::Mock.new
tl_current_mock.expect :add_custom_attributes, -> { attribute_set_attempted = true }, [attrs]

attribute_set_attempted = false
in_transaction do
Transaction.stub :tl_current, tl_current_mock do
::NewRelic::Agent.add_custom_attributes(attrs)
Expand Down

0 comments on commit 47b4f48

Please sign in to comment.