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.