Skip to content
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

simplify tests and check against new-ets branch #27

Closed
wants to merge 2 commits into from

Conversation

ruslandoga
Copy link

@ruslandoga ruslandoga commented Nov 25, 2023

This PR checks that the tests pass with changes in ExHammer/hammer#104

To actually make the tests check integration with Hammer I removed Mock.

@@ -210,7 +214,8 @@ defmodule Hammer.Plug do
{:deny, _n} ->
on_deny_handler.(conn, [])

{:error, _reason} ->
{:error, reason} ->
Logger.error(check_rate_fail_reason: reason)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should raise an exception, I think. Plug would catch it, send 500, and then re-raise.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Hammer as well, I think {:error, reason}` return value can be removed in favor of an exception since it's unclear what should be done in that case, allow or deny.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: #35

mix.exs Outdated
{:hammer, "~> 6.0"},
{:plug, "~> 1.0"},
{:mock, "~> 0.3.0", only: :test}
{:hammer, github: "ruslandoga/hammer", branch: "new-ets"},
Copy link
Author

@ruslandoga ruslandoga Nov 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be changed to ~> 7.0 once ExHammer/hammer#104 is merged.

@@ -1 +1,2 @@
{:ok, _apps} = Application.ensure_all_started([:plug])
Copy link
Author

@ruslandoga ruslandoga Nov 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:plug doesn't need to be started since the tests are not using Plug.Upload

@ruslandoga ruslandoga marked this pull request as ready for review November 25, 2023 11:57
@ruslandoga ruslandoga closed this Nov 16, 2024
@ruslandoga ruslandoga deleted the simplify-tests branch November 16, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant