I'm writing this because tooling that can ingest the code coverage report produced by
swift test --enable-code-coverage is shockingly hard to find.
The library has a pretty small and straight forward interface. I have not had time to write about it here in the README, but taking a look at how the executable target uses the library target should be pretty informative.
USAGE: swift-test-codecov <codecov-filepath> [--metric <metric>] [--minimum <minimum-coverage>] [--print-format <print-format>] [--sort <sort>] [--dependencies] ARGUMENTS: <codecov-filepath> the location of the JSON file output by `swift test --enable-code-coverage`. You will find this in the build directory. For example, if you've just performed a debug build, the file will be located at `./.build/debug/codecov/<package-name>.json`. OPTIONS: -m, --metric <metric> The metric over which to aggregate. One of lines, functions, instantiations (default: lines) -v, --minimum <minimum-coverage> The minimum coverage allowed. A value between 0 and 100. Coverage below the minimum will result in exit code 1. (default: 0) -p, --print-format <print-format> Set the print format. One of minimal, table, json (default: minimal) -s, --sort <sort> Set the sort order for the coverage table. One of filename, +cov, -cov (default: filename) -d, --dependencies Include dependencies in code coverage calculation. -h, --help Show help information.
docker build -t swift-test-codecov . to build the docker image.
|Last commit: 23 weeks ago|
Without changing the actual aggregation features, adds the ability to print a JSON representation of results containing all the information used in building out the table output and the summary.