Background
I am using excoveralls in an umbrella project with several children.
I have set up the children to use Excoveralls like this:
For normal Elixir applications:
def project do
[
app: :app1,
version: "3.1.0",
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
deps: deps(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: preferred_cli_env()
]
end
And for a Phoenix child, the configuration is slightly different:
def project do
[
app: :phoenix_app_1,
version: "2.2.1",
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
elixir: "~> 1.16",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),
start_permanent: Mix.env() == :prod,
deps: deps(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: preferred_cli_env()
]
end
defp deps do
[
# Phoenix
# ....
# I dont know why I have to explicity include excoveralls here
# but if I dont `mix coveralls` wont work for Phoenix child apps
{:excoveralls, "~> 0.18", only: :test},
]
end
For both types of apps the preferred_cli_env
set to this:
defp preferred_cli_env,
do: [
coveralls: :test,
"coveralls.detail": :test,
"coveralls.post": :test,
"coveralls.html": :test,
"coveralls.github": :test
]
Problem
When I run mix coveralls
it runs all tests from each child app sequentially, due to my customized mix test
alias:
defp aliases do
child_tests =
Path.wildcard("apps/*")
|> Enum.map(&String.replace(&1, "apps/", ""))
|> Enum.map(fn app -> "cmd --app #{app} mix test --color" end)
[test: child_tests]
end
So what ends up happening, is that coveralls will run the coverage for each app, and then only present me with the coverage for the last app run.
This is a problem. I don’t want the coverage of only the last child app, I want the coverage of all child apps, inside the project, so i know the overall test coverage of the project.
Questions
- Is this possible to do with coveralls?
- If so, how?