Integrate Code Coverage Formats
Qlty accepts coverage data in multiple formats compatible with various tools and languages. If your specific format is not supported, you can easily convert your code coverage report to the qlty
format to ensure smooth integration.
See Supported Languages and Formats for more information.
Qlty Format
Qlty supports the import of a generic format, named qlty
, which can be used as a target for custom conversion of reports from tools that are not directly supported.
This means you can convert the report file produced by your code coverage tool into the qlty
format and then upload the converted report.
Specification
The qlty
format follows the JSON Lines text file format, also called newline-delimited JSON. Each line contains one JSON object.
The structure of each JSON object is described using the JSON schema standard, a declarative language that provides a standardized way to describe JSON data.
Following, an example of a consolidated qlty
report:
JSON Lines files are generally saved with the .jsonl
extension, so it’s recommended to save your
qlty
formatted coverage report with this extension.
The path
Property
Ideally, the file path for your code coverage report should be relative to your Git project’s root. However, you can transform the path using the universal reporter tool with the --strip-prefix
and --add-prefix
flags, modifying the final path of the uploaded report.
The hits
Property
Depending on the tool used to exercise your code base, a single line could be:
- Irrelevant regarding code coverage (e.g., comments) (“-1”)
- Not covered (“0”)
- Covered, possibly multiple times.
This structure ensures that you can translate and submit coverage reports in a consistent format, regardless of the tool used to generate them.
Uploading a qlty
formatted Coverage Report
Uploading a qlty
formatted coverage report is no different than uploading a code coverage report in any other format. Follow these steps:
-
Convert your report to the
qlty
format. -
Get your Qlty coverage token from your project’s settings page under the Code Coverage section.
-
Upload the report using Qlty’s coverage reporter:
For explicitness, you can use the --format=qlty
flag to specify the format, though qlty
will infer it by default:
Need help?
If you need support for a specific code coverage format, contact our support team. We may be able to complete the process within one week.