Sha256: 0d20e32deed66dca7791d88aee3ab4b5719cd8c9600f3951510b43115a91ba87

Contents?: true

Size: 836 Bytes

Versions: 13

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe GraphQL::Tracing::PrometheusTracing do
  module PrometheusTracingTest
    class Query < GraphQL::Schema::Object
      field :int, Integer, null: false

      def int
        1
      end
    end

    class Schema < GraphQL::Schema
      query Query
    end
  end

  describe "Observing" do
    it "sends JSON to Prometheus client" do
      client = Minitest::Mock.new

      client.expect :send_json, true do |obj|
        obj[:type] == 'graphql' &&
          obj[:key] == 'execute_field' &&
          obj[:platform_key] == 'Query.int'
      end

      PrometheusTracingTest::Schema.use(
        GraphQL::Tracing::PrometheusTracing,
        client: client,
        trace_scalars: true
      )

      PrometheusTracingTest::Schema.execute "query X { int }"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
graphql-1.8.18 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.17 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.16 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.15 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.14 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.13 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.12 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.11 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.10 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.9 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.8 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.7 spec/graphql/tracing/prometheus_tracing_spec.rb
graphql-1.8.6 spec/graphql/tracing/prometheus_tracing_spec.rb