Skip to content

Commit

Permalink
Update the Oban test suite to match the spec
Browse files Browse the repository at this point in the history
  • Loading branch information
joshk committed Nov 5, 2024
1 parent e21822f commit bfef35d
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions instrumentation/opentelemetry_oban/test/opentelemetry_oban_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ defmodule OpentelemetryObanTest do
)}

assert %{
"messaging.destination": "events",
"messaging.destination_kind": :queue,
"messaging.destination.name": "events",
"messaging.system": :oban,
"oban.job.job_id": _job_id,
"oban.job.max_attempts": 1,
"oban.job.priority": 0,
"oban.job.worker": "TestJob",
"messaging.system": :oban
"oban.job.worker": "TestJob"
} = :otel_attributes.map(attributes)
end

Expand Down Expand Up @@ -145,17 +144,16 @@ defmodule OpentelemetryObanTest do
)}

assert %{
"messaging.destination": "events",
"messaging.destination_kind": :queue,
"messaging.destination.name": "events",
"messaging.operation.type": :process,
"messaging.system": :oban,
"oban.job.attempt": 1,
"oban.job.inserted_at": _inserted_at,
"oban.job.job_id": _job_id,
"oban.job.max_attempts": 1,
"oban.job.priority": 0,
"oban.job.scheduled_at": _scheduled_at,
"oban.job.worker": "TestJob",
"messaging.operation": :process,
"messaging.system": :oban
"oban.job.worker": "TestJob"
} = :otel_attributes.map(attributes)
end

Expand All @@ -175,17 +173,16 @@ defmodule OpentelemetryObanTest do
)}

assert %{
"messaging.destination": "events",
"messaging.destination_kind": :queue,
"messaging.destination.name": "events",
"messaging.operation.type": :process,
"messaging.system": :oban,
"oban.job.attempt": 1,
"oban.job.inserted_at": _inserted_at,
"oban.job.job_id": _job_id,
"oban.job.max_attempts": 1,
"oban.job.priority": 0,
"oban.job.scheduled_at": _scheduled_at,
"oban.job.worker": "TestJobThatReturnsError",
"messaging.operation": :process,
"messaging.system": :oban
"oban.job.worker": "TestJobThatReturnsError"
} = :otel_attributes.map(attributes)

[
Expand Down Expand Up @@ -253,17 +250,16 @@ defmodule OpentelemetryObanTest do
)}

assert %{
"messaging.destination": "events",
"messaging.destination_kind": :queue,
"messaging.destination.name": "events",
"messaging.operation.type": :process,
"messaging.system": :oban,
"oban.job.attempt": 1,
"oban.job.inserted_at": _inserted_at,
"oban.job.job_id": _job_id,
"oban.job.max_attempts": 1,
"oban.job.priority": 0,
"oban.job.scheduled_at": _scheduled_at,
"oban.job.worker": "TestJobThatThrowsException",
"messaging.operation": :process,
"messaging.system": :oban
"oban.job.worker": "TestJobThatThrowsException"
} = :otel_attributes.map(attributes)

[
Expand Down

0 comments on commit bfef35d

Please sign in to comment.