nasa / Common-Metadata-Repository

Apache License 2.0
337 stars 92 forks source link

CMR-9891: parallel unit tests #2119

Closed jceaser closed 3 months ago

jceaser commented 3 months ago

Overview

This is an effort to speed up unit test phase in bamboo by running unit tests in parallel.

What is the feature/fix?

Run modules in parallel to take advantage of multi-core processors.

What is the Solution?

To run the unit tests in parallel a python script is used to create a pool of jobs and a set of "work-bees" to process them. The script requests from lein the number of modules to be processed and the script then filters out known modules with no tests, and also a small set of modules that can not be run in parallel. All remaining modules have their unit tests run. When all these modules are done, the remaining modules run one at a time.

the top level lein responds to lein ci-utest which will start the python script and run the tests.

What areas of the application does this impact?

In order for this to work, two things must happen:

  1. a new cmr builder docker image is needed. The needed docker image has been created
  2. the bamboo build scripts must be changed to take advantage of this new call

Checklist

jmaeng72 commented 3 months ago

Agree with Tyler's comments. Approved with assumption of changes from Tyler's comments

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 57.77%. Comparing base (b9b874e) to head (62b7239). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2119 +/- ## ======================================= Coverage 57.77% 57.77% ======================================= Files 1044 1044 Lines 70356 70356 Branches 1996 1997 +1 ======================================= Hits 40645 40645 + Misses 27851 27850 -1 - Partials 1860 1861 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.