Closed zachallaun closed 1 year ago
Additional context for my own use-case:
I'm working on a library that modifies the behavior of mix test
. To do end-to-end integration testing, some test modules are dynamically generated, saved to a temp directory, and run using a shell command to mix test
.
test_command = """
echo "#{test.test_input}" | \
CI=false mix test #{file_path} \
--seed 0
"""
task = Task.async(System, :shell, [test_command])
This change allows me to save out the coverage data from those tests and include them in the final coverage report, all within the same test run:
test_command = """
echo "#{test.test_input}" | \
CI=false mix test #{file_path} \
--seed 0 \
--cover \
--export-coverage #{test.name}
"""
task = Task.async(System, :shell, [test_command])
Now I can run the following:
$ mix coveralls --import-cover cover
Just wanted to bump this in case it can sneak into the release you mentioned might be later today, @parroty! No worries if not :)
Thank you for the follow-up 🙇 .
And thank you for the work you do!
Hi friends! Thanks for such a great tool.
This PR adds additional documentation/usage for the
--import-cover
flag and makes a change that improves the ergonomics of integration test coverage..coverdata
is now imported just beforeExCoveralls.execute/3
, instead of duringExCoveralls.start/2
. This allows coverage data generated during the test run to be included in the final report.--import_cover
->--import-cover
--import-cover
usage./cc @albertored, who first introduced this feature