In order to use the Test Gap analysis, you’ll need to upload test coverage to Teamscale.
Teamscale allows you to upload the source maps ahead of time, e.g., when they are created during the build process. Then, when uploading coverage files, it will use the mapping files to interpret the coverage information. Since every time you build your application, new mapping files are generated, Teamscale needs to know, which mapping files to use when you upload coverage. Thus, during the upload of the mapping files, you must provide a version string (any unique string will do, e.g., a revision number). You must provide the exact same version string again when uploading coverage files that belong to those mapping files.
Please note that errors in the source maps can lead to subtle misalignment of the covered lines and thus to wrong coverage results. Please make absolutely sure that source maps are configured correctly for your entire build pipeline and that they correctly map back to your source files. Some minification/bundling tools are known to e.g., produce off-by-one source maps.
# Uploading Source Maps
The following is an example of how to upload source map files using curl:
branch:timestamp must be the branch name and commit timestamp in milliseconds of the commit which was processed by the build to generate the mapping file.
# Uploading Coverage files
The following is an example of how to upload Istanbul coverage files using curl:
curl --request POST \ --user bob:e434mikm35d \ --form "report=@./coverage.json" \ localhost:8080/api/projects/PROJECTID/external-analysis/istanbul-test-coverage?message=myMessage&partition=myPartition&version=version