Hermanverschooten

Hermanverschooten

Mix test ignoring --no-compile?

Hi all,

Noticed something strange today.

Working with Erlang 28.5, Elixir 1.19.5-otp-28.

I was working with a new project where I have just created my test workflow, I always follow the same flow, a build step that compiles and caches, then a test, format and security step that uses the cached build. As this project uses Ash which takes a long time to compile and 1 incredible large liveview I suddenly noticed that the mix ecto.load command took 28 seconds to run. I check the log and it said compiling 224 files and that that liveview took more than 10s.

Strange. I looked into the caching thinking maybe something off there, but it all looks good and the format and security jobs do not exhibit the same recompiling.

Further investigation (Claude) let me to believe that the file times are newer than the restore _build folder triggering `mix` to recompile.

So I changed 'mix ecto.load to mix ecto.load –no-compile and it went down to 3s, nice.

But alas the next statement mix test –no-compile –trace –exclude not_implemented –max-failures 1 ignores the –no-compile flag and compiles the app.

Am I missing something here?

It is easy to test on your local machine.

mix test --no-compile
Generated dashboard app
Running ExUnit with seed: 602546, max_cases: 28

.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 13.1 seconds (8.3s async, 4.8s sync)
849 tests, 0 failures

mix test --no-compile
Running ExUnit with seed: 22162, max_cases: 28

.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 12.9 seconds (8.3s async, 4.6s sync)
849 tests, 0 failures

touch mix.exs

mix test --no-compile
Generated dashboard app
Running ExUnit with seed: 463358, max_cases: 28

.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Finished in 12.4 seconds (8.4s async, 4.0s sync)
849 tests, 0 failures

The first time you can see it compiled the Generated dashboard app, the second time it didn’t, after touching mix.exs, it compiled again.

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement