How to split test by suite (parallel tests build feature)?

I want to split my Jest/Junit tests by suite (since class is not detected for the them). Is this an option?

Teamcity is only running 1 parallel build with all tests rather than 2 as I have specified in the build feature.

I'm using “jest-junit”, “jest-teamcity” as reporters for my tests?

0
3 comments

For example my included tests only include 1 test suite rather than the 3 I have run. I could probably get around this if I could even force more parallel builds but that doesn't seem to be an option. It would be great if there was more transparency on how the Parallel Test feature works - is there somewhere I can look in Teamcity?
 

  #version=1

  #algorithm=duration

  #current_batch=1

  #total_batches=1

  #suite=src/modules/analysis/test/api/analysis_context1.api-spec.ts: AnalysisContextAPI Tests - MSN 1600 - the other MSN 1285

0

Hi Luke,

You can try to use another algorithm, by setting the build parameter :
 

teamcity.internal.parallelTests.type=group suites

 

Using this property, the algorithm splits tests only by suites, ignoring classes. Using this, it will run build tests with sharding:

yarn test --shard=%teamcity.build.parallelTests.currentBatch%/%teamcity.build.parallelTests.totalBatches% --coverage

Please note that you must have more than one test suite for the split to work.
 

0

Great thank you very much this worked perfectly.


 

0

Please sign in to leave a comment.