elixir-wallaby / wallaby

Concurrent browser tests for your Elixir web apps.
https://twitter.com/elixir_wallaby
MIT License
1.68k stars 198 forks source link

Suggested Phoenix Configuration for Concurrent Feature Test Issues Warning #761

Closed stratigos closed 7 months ago

stratigos commented 7 months ago

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.16.1 (compiled with Erlang/OTP 24)

Operating system

Ubuntu 22.04

Browser

N/A

Driver

chromedriver 123

Correct Configuration

Current behavior

When following the current installation guide from here: https://github.com/elixir-wallaby/wallaby?tab=readme-ov-file#phoenix, specifically this section:

  if sandbox = Application.get_env(:your_app, :sandbox) do
    plug Phoenix.Ecto.SQL.Sandbox, sandbox: sandbox
  end

The following warning is issued:

    warning: Application.get_env/2 is discouraged in the module body, use Application.compile_env/3 instead
    │
 10 │   if sandbox = Application.get_env(:my_app, :sandbox) do
    │                            ~
    │
    └─ lib/myapp_web/endpoint.ex:10:28: MyAppWeb.Endpoint (module)

Expected behavior

The documentation has up-to-date instructions that do not result in a warning.

Test Code & HTML

No test needed, simply run app after following wallaby README for installing with a Phoenix app

ca. https://github.com/elixir-wallaby/wallaby/commit/cab3b1fbd8f0bcbcd72ac49f33f339ed71a593e5

Demonstration Project

No response

mhanberg commented 7 months ago

PR welcome