0

So when running ExUnit with the stale option, why is this line ExUnit.Server.modules_loaded() called?

I think this line Kernel.ParallelCompiler.require(test_files, parallel_require_callbacks) is needed to require the ex_unit test files to be able to run in parallel.

I can follow the source code tracing of ExUnit.Server.modules_loaded() in the ExUnit.Server module, but I'm a bit unclear as to the high level purpose of what the take_modules function call is doing and why it is doing what it does? It just seems to be updating the GenServer state and doing some kind of reply...is the purpose simply to ensure the modules are loaded and store the state of that "loading" so a programmer can "peek" at that state?

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
Nona
  • 5,302
  • 7
  • 41
  • 79

1 Answers1

0

Admittedly, it's a little unclear precisely what you're asking. As to the particular line you call out, that line is what is loading the test cases to ExUnit. Which fits in with your earlier understanding, the test files are loaded, then the test cases themselves are pulled in by the command you've called out ExUnit.Server.modules_loaded(). Then the tests are run. Line 45 of of the linked file %{failures: failures} = results = Task.await(task, :infinity) is executing the task defined on Line 36 task = Task.async(ExUnit, :run, [])

JustAnotherSoul
  • 350
  • 3
  • 14