Skip to content

Commit

Permalink
fix: test to be more accurate (#133)
Browse files Browse the repository at this point in the history
## Related Ticket(s)
[SIGNAL-7636](https://stord.atlassian.net/browse/SIGNAL-7636)
<!--
Enter the Jira issue below in the following format: PROJECT-##
-->

## Checklist

<!--
For each bullet, ensure your pr meets the criteria and write a note
explaining how this PR relates. Mark them as complete as they are done.
All top-level checkboxes should be checked regardless of their relevance
to the pr with a note explaining whether they are relevant or not.
-->

- [x] Code conforms to the [Elixir
Styleguide](https://github.com/christopheradams/elixir_style_guide)

## Problem
There is a unit test that needs to be adjusted to ensure expected map
struct is compared in equality, not pattern matched.

<!--
What is the problem you're solving or feature you're implementing? Link
to any Jira tickets or previous discussions of the issue.
-->

## Details
The test is adjusted.
<!--
Include a brief overview of the technical process you took (or are going
to take!) to get from the problem to the solution.
-->


[SIGNAL-7636]:
https://stord.atlassian.net/browse/SIGNAL-7636?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
seungjinstord authored Jan 16, 2025
1 parent 0290874 commit ed7a92c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/kafee/consumer/brod_monitor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ defmodule Kafee.Consumer.BrodMonitorTest do
[consumer_pid: consumer_pid]
end

test "should correctly handle zero consumed case", %{
test "should correctly handle edge case when no offset is committed yet", %{
brod_client_id: brod_client_id,
topic: topic,
partitions: partitions,
consumer_group_id: consumer_group_id
} do
assert :ok =
Expand All @@ -78,10 +77,7 @@ defmodule Kafee.Consumer.BrodMonitorTest do
}
])

partitions_list = Enum.map(0..(partitions - 1), & &1)
assert :ok = poll_until_offset_tick(topic, partitions_list, [{0, 1}])

assert {:ok, %{}} =
assert {:ok, %{}} ==
BrodMonitor.get_consumer_lag(brod_client_id, Kafee.BrodApi.endpoints(), topic, consumer_group_id)
end

Expand Down

0 comments on commit ed7a92c

Please sign in to comment.