Commit 9c4df81b authored by Bob Van Landuyt's avatar Bob Van Landuyt

Ensure we don't track apdex for failing queries

parent 03b07391
# frozen_string_literal: true # frozen_string_literal: true
require 'fast_spec_helper' require 'spec_helper'
require 'rspec-parameterized' require 'rspec-parameterized'
require "support/graphql/fake_query_type" require "support/graphql/fake_query_type"
...@@ -36,7 +36,7 @@ RSpec.describe Gitlab::Graphql::Tracers::MetricsTracer do ...@@ -36,7 +36,7 @@ RSpec.describe Gitlab::Graphql::Tracers::MetricsTracer do
end end
with_them do with_them do
it 'increments sli' do it 'increments apdex sli' do
# Trigger initialization # Trigger initialization
fake_schema fake_schema
...@@ -56,5 +56,13 @@ RSpec.describe Gitlab::Graphql::Tracers::MetricsTracer do ...@@ -56,5 +56,13 @@ RSpec.describe Gitlab::Graphql::Tracers::MetricsTracer do
fake_schema.execute("query lorem { helloWorld }") fake_schema.execute("query lorem { helloWorld }")
end end
end end
it "does not record apdex for failing queries" do
query_string = "query fooOperation { breakingField }"
expect(Gitlab::Metrics::RailsSlis.graphql_query_apdex).not_to receive(:increment)
expect { fake_schema.execute(query_string) }.to raise_error(/This field is supposed to break/)
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment