Skip to content

Mix test compiles even when nothing has changed #12801

@joaopsramos

Description

@joaopsramos

Elixir and Erlang/OTP versions

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

Elixir 1.15.3 (compiled with Erlang/OTP 26)

Operating system

Arch

Current behavior

In an umbrella project, after removing the _build directory, when I initially run mix test apps/some_app/some_test.exs, it performs the first compilation as expected. However, upon subsequent runs, it triggers another compilation, although smaller. This behavior persists for several runs until it eventually stops compiling, which is the expected behavior since nothing has changed. In my case, this occurs around the fourth run, the compilation output also changes on every run.

I couldn't create a project that exactly reproduces this recompilation issue, however, after some investigation, I suspect this bug was introduced in f3c4c8c. Reverting this commit fixes the problem, it appears that the new removed variable is not empty when it should be (I think?).

To reproduce the behavior above, create an umbrella project with two apps. When running a test with IO.inspect on the removed variable, it produces the following output:

bar_foo

Expected behavior

Mix test should not compile again if no file has changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions