-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: watcher's /status.get cabbage test #1508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 moar cabbages
defthen ~r/^Operator can read byzantine_events$/, %{}, state do | ||
assert is_list(state.service_response["data"]["byzantine_events"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read eth_syncing$/, %{}, state do | ||
assert is_boolean(state.service_response["data"]["eth_syncing"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read in_flight_exits$/, %{}, state do | ||
assert is_list(state.service_response["data"]["in_flight_exits"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read last_mined_child_block_number$/, %{}, state do | ||
assert is_integer(state.service_response["data"]["last_mined_child_block_number"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read last_mined_child_block_timestamp$/, %{}, state do | ||
assert is_integer(state.service_response["data"]["last_mined_child_block_timestamp"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read last_seen_eth_block_number$/, %{}, state do | ||
assert is_integer(state.service_response["data"]["last_seen_eth_block_number"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read last_seen_eth_block_timestamp$/, %{}, state do | ||
assert is_integer(state.service_response["data"]["last_seen_eth_block_timestamp"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read last_validated_child_block_number$/, %{}, state do | ||
assert is_integer(state.service_response["data"]["last_validated_child_block_number"]) | ||
{:ok, state} | ||
end | ||
|
||
defthen ~r/^Operator can read last_validated_child_block_timestamp$/, %{}, state do | ||
assert is_integer(state.service_response["data"]["last_validated_child_block_timestamp"]) | ||
{:ok, state} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels like we could probably DRY this up a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm do you have an example? These are specific to this test file so I didn't DRY them up so to keep them straight forward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I see the word DRY in elixir-omg repo being brought up I get triggered. :))))
Overview
Script kiddie trying to move the simplest integration test (/status.get) into cabbage.
Changes
OMG.Watcher.Integration.StatusTest
WatcherStatus
cabbage testTesting