For applications with large test suites, you can greatly accelerate your builds by running the test cases in parallel using a tool like Knapsack Pro.
AppMap Analysis works great with parallel builds, because the scanning can also be distributed across the jobs (aka workers, containers). Parallel builds can reduce test execution from hours to minutes, and when AppMap Analysis is performed in parallel, it adds negligible overhead to the build process.
The @appland/scanner
CLI provides two features to facilitate parallel scanning:
ci --merge-key
associates the scan results for each job with a merge-key
that is common to all the parallelized jobs.merge
is invoked after all the jobs are complete, using the merge-key
to merge the scan results together.Follow the instructions for your CI tool to configure the parallel build.
ci
with --merge-key
in each jobThe merge key identifies the build number.
Examples
TRAVIS_BUILD_NUMBER
CI_PIPELINE_IID
BUILD_NUMBER
$ npx @appland/scanner ci -c appmap-analysis-config.yml -d tmp/appmap --merge-key=$BUILD_NUMBER
..!.......!..........!..........!..........!..........!....................!!...
....!..........!..........!..........!.....................!..........!.........
...
Creating mapset in app mycorp/myapp-server with 2 AppMaps
Uploading findings
Uploaded 2 findings to https://app.land/scanner_jobs/121
merge
command in the final build stage$ npx @appland/scanner merge $BUILD_NUMBER
Merging scan results in app mycorp/myapp-server with merge key 10348
Merged results to https://app.land/scanner_jobs/130215
See the Integrating with CI (Basic) guide for details.