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

chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
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
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
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
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

We're in Beta

About us Mission Statement