Skip to content

Commit

Permalink
Add test case for handle batch
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Oct 29, 2024
1 parent afc0487 commit 4d0f688
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/uplink/metrics/pipeline_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,16 @@ defmodule Uplink.Metrics.PipelineTest do

assert not is_nil(load_15)
end

test "handle batch", %{
message_with_previous_cpu_metric: message1,
message_with_previous_network_metric: message2
} do
ref = Broadway.test_batch(Uplink.Metrics.Pipeline, [message1, message2])

assert_receive {:ack, ^ref, successful, failed}, 10_000

assert length(successful) == 2
assert length(failed) == 0
end
end

0 comments on commit 4d0f688

Please sign in to comment.