File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
modules/integration-node/src Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 1515 */
1616
1717import yargs from 'yargs'
18+ import { needs } from '@aws-crypto/client-node'
19+ import { cpus } from 'os'
1820import { integrationDecryptTestVectors , integrationEncryptTestVectors } from './integration_tests'
1921
2022const cli = yargs
@@ -59,9 +61,16 @@ const cli = yargs
5961 } )
6062 . option ( 'concurrency' , {
6163 alias : 'c' ,
62- describe : 'an optional concurrency for running tests' ,
63- type : 'number' ,
64- default : 1
64+ describe : `an optional concurrency for running tests, pass 'cpu' to maximize` ,
65+ default : 1 ,
66+ coerce : ( value : any ) => {
67+ if ( typeof value === 'string' ) {
68+ needs ( value . toLowerCase ( ) === 'cpu' , `The only supported string is 'cpu'` )
69+ return cpus ( ) . length - 1
70+ }
71+ needs ( typeof value === 'number' && value > 0 , `Must be a number greater than 0` )
72+ return value
73+ }
6574 } )
6675 . demandCommand ( )
6776
Original file line number Diff line number Diff line change 3232 "integration-browser-decrypt" : " npm run build; integration-browser decrypt -v $npm_package_config_localTestVectors --karma -c cpu" ,
3333 "integration-browser-encrypt" : " npm run build; integration-browser encrypt -m $npm_package_config_encryptManifestList -k $npm_package_config_encryptKeyManifest -o $npm_package_config_decryptOracle --karma -c cpu" ,
3434 "browser-integration" : " run-s integration-browser-*" ,
35- "integration-node-decrypt" : " npm run build; integration-node decrypt -v $npm_package_config_localTestVectors -c 10 " ,
36- "integration-node-encrypt" : " npm run build; integration-node encrypt -m $npm_package_config_encryptManifestList -k $npm_package_config_encryptKeyManifest -o $npm_package_config_decryptOracle -c 20 " ,
35+ "integration-node-decrypt" : " npm run build; integration-node decrypt -v $npm_package_config_localTestVectors -c cpu " ,
36+ "integration-node-encrypt" : " npm run build; integration-node encrypt -m $npm_package_config_encryptManifestList -k $npm_package_config_encryptKeyManifest -o $npm_package_config_decryptOracle -c cpu " ,
3737 "node-integration" : " run-s integration-node-*" ,
3838 "integration" : " run-s integration-*" ,
3939 "test_conditions" : " ./util/test_conditions"
You can’t perform that action at this time.
0 commit comments