Skip to content
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

do not blow up on missing newrelic apps #1615

Merged
merged 1 commit into from Jan 4, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/new_relic/lib/samson_new_relic/api.rb
Expand Up @@ -55,7 +55,7 @@ def response(values)

def application_map(application_names)
application_names.each_with_object({}) do |app_name, map|
app = applications[app_name]
next unless app = applications[app_name]
map[app_name] = (yield app).merge(id: app.id)
end
end
Expand Down
5 changes: 5 additions & 0 deletions plugins/new_relic/test/samson_new_relic/api_test.rb
Expand Up @@ -77,6 +77,11 @@ def stub_metric_api(field, value)
it 'returns accurate count' do
subject[:count].must_equal(2)
end

it 'ignores apps that are in the DB but deleted from newrelic' do
assert SamsonNewRelic::Api.applications.delete('Production')
subject[:applications].size.must_equal(1)
end
end

describe 'not initial' do
Expand Down