Skip to content

[Bug] Having a tools app in umbrella fails when running tests with coverage #11300

Closed
@mindreframer

Description

@mindreframer

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
  • Operating system:
$ elixir --version
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Elixir 1.12.2 (compiled with Erlang/OTP 24)

OS: Mac OS Big Sur (11.5.11) on Apple M1

Current behavior

$ mix new toolstest --umbrella
$ cd  toolstest
$ pushd apps ; mix new app1 ; popd 
$ mix test --cover
==> app1
Cover compiling modules ...
..

Finished in 0.02 seconds (0.00s async, 0.02s sync)
1 doctest, 1 test, 0 failures

Randomized with seed 632509

Generating cover results ...

Percentage | Module
-----------|--------------------------
   100.00% | App1
-----------|--------------------------
   100.00% | Total

Generated HTML coverage results in "cover" directory

$ pushd apps ; mix new tools ; popd 
$ mix test --cover
==> tools
Compiling 1 file (.ex)
Generated tools app
==> app1
Cover compiling modules ...
..

Finished in 0.02 seconds (0.00s async, 0.02s sync)
1 doctest, 1 test, 0 failures

Randomized with seed 570422

Generating cover results ...

Percentage | Module
-----------|--------------------------
   100.00% | App1
-----------|--------------------------
   100.00% | Total

** (exit) an exception was raised:
    ** (MatchError) no match of right hand side value: {:error, :enoent}
        cover.erl:2937: :cover.read_stylesheet/0
        cover.erl:2893: :cover.create_header/2
        cover.erl:2780: :cover.do_analyse_to_file1/4
        cover.erl:2759: :cover.do_parallel_analysis_to_file/5
    cover.erl:774: :cover.call/1
    (mix 1.12.2) lib/mix/tasks/test.coverage.ex:209: anonymous fn/3 in Mix.Tasks.Test.Coverage.html/2
    (elixir 1.12.2) lib/enum.ex:2385: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.12.2) lib/mix/tasks/test.coverage.ex:208: Mix.Tasks.Test.Coverage.html/2
    (mix 1.12.2) lib/mix/tasks/test.ex:520: Mix.Tasks.Test.do_run/3
    (mix 1.12.2) lib/mix/task.ex:394: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.12.2) lib/mix/project.ex:353: Mix.Project.in_project/4
    (elixir 1.12.2) lib/file.ex:1560: File.cd!/2
    (mix 1.12.2) lib/mix/task.ex:520: anonymous fn/4 in Mix.Task.recur/1
    (elixir 1.12.2) lib/enum.ex:2385: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.12.2) lib/mix/task.ex:519: Mix.Task.recur/1
    (mix 1.12.2) lib/mix/project_stack.ex:181: Mix.ProjectStack.recur/1
    (mix 1.12.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2
    (elixir 1.12.2) lib/code.ex:1261: Code.require_file/2

Expected behavior

It should be possible to have an app named tools in an umbrella project without issues.

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