Skip to content

Commit

Permalink
Remove old telemetry tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-secord committed Aug 11, 2020
1 parent a9deb08 commit d2b71b8
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions test/absinthe/schema/notation/experimental/import_sdl_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -570,45 +570,4 @@ defmodule Absinthe.Schema.Notation.Experimental.ImportSdlTest do
Code.eval_string(schema)
end)
end

def handle_event(event, measurements, metadata, config) do
send(self(), {event, measurements, metadata, config})
end

describe "telemetry" do
setup context do
:telemetry.attach_many(
context.test,
[
[:absinthe, :resolve, :field, :start],
[:absinthe, :resolve, :field, :stop],
[:absinthe, :execute, :operation, :start],
[:absinthe, :execute, :operation, :stop]
],
&__MODULE__.handle_event/4,
%{}
)

on_exit(fn ->
:telemetry.detach(context.test)
end)

:ok
end

test "executes on SDL defined schemas" do
assert {:ok,
%{data: %{"posts" => [%{"upcasedTitle" => "FOO"}, %{"upcasedTitle" => "BAR"}]}}} =
Absinthe.run(@query, Definition)

assert_receive {[:absinthe, :execute, :operation, :start], _, %{id: id}, _config}
assert_receive {[:absinthe, :execute, :operation, :stop], measurements, %{id: ^id}, _config}

assert_receive {[:absinthe, :resolve, :field, :start], measurements,
%{resolution: %{definition: %{name: "posts"}}}, config}

assert_receive {[:absinthe, :resolve, :field, :stop], measurements,
%{resolution: %{definition: %{name: "posts"}}}, config}
end
end
end

0 comments on commit d2b71b8

Please sign in to comment.