malach-it / boruta_auth

A yet complex but OpenID™ certified OAuth / OpenID Connect provider core
MIT License
53 stars 10 forks source link

Tests failing on file compilation in `test/mix/tasks/boruta.gen.controllers_test.exs:24` #6

Closed lnchan closed 1 year ago

lnchan commented 1 year ago

Seems to happen when compiling the file views/oauth_view.ex, I am not sure what causes it (it might be because phoenix_view is missing from the dependencies)

  1) test compiles files without any errors (Mix.Tasks.Boruta.Gen.ControllersTest)
     test/mix/tasks/boruta.gen.controllers_test.exs:24
     ** (CompileError) nofile:2: module Phoenix.View is not loaded and could not be found
     stacktrace:
       (elixir 1.14.3) src/elixir_expand.erl:90: :elixir_expand.expand/3
       (elixir 1.14.3) src/elixir_expand.erl:536: :elixir_expand.expand_block/5
       (elixir 1.14.3) src/elixir_expand.erl:40: :elixir_expand.expand/3
       (elixir 1.14.3) expanding macro: Kernel.use/2
       nofile:2: Boruta.Support.WebModule.OauthView (module)
       (boruta 2.3.0) expanding macro: Boruta.Support.WebModule.__using__/1
       nofile:2: Boruta.Support.WebModule.OauthView (module)
       (elixir 1.14.3) expanding macro: Kernel.use/2
       nofile:2: Boruta.Support.WebModule.OauthView (module)

This is with macOS 13.3 on Apple Silicon (aarch64) and Elixir 1.14.3, installed from Homebrew. (Erlang/OTP 25 [erts-13.1.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace])

patatoid commented 1 year ago

Hi @lnchan ,

This issue my be due to the non compatibility of the generated application layer (controller/views/templates) with phoenix 1.7. Have a look at #7, someone found a way to make the views 1.7 compliant.

We may implement a way to have a flag to generate files for both < 1.7 and 1.7 phoenix versions.

lnchan commented 1 year ago

Hello,

This happens when running mix test on the library itself. I haven't tried using it in a project yet.

patatoid commented 1 year ago

The tests are fixed in commit.

That said there is still work to support Phoenix 1.7 to be done.

lnchan commented 1 year ago

Thank you; this does fix the unit tests for the library!