File tree 2 files changed +14
-5
lines changed
modules/integration-node/src
2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
17
17
import yargs from 'yargs'
18
+ import { needs } from '@aws-crypto/client-node'
19
+ import { cpus } from 'os'
18
20
import { integrationDecryptTestVectors , integrationEncryptTestVectors } from './integration_tests'
19
21
20
22
const cli = yargs
@@ -59,9 +61,16 @@ const cli = yargs
59
61
} )
60
62
. option ( 'concurrency' , {
61
63
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
+ }
65
74
} )
66
75
. demandCommand ( )
67
76
Original file line number Diff line number Diff line change 32
32
"integration-browser-decrypt" : " npm run build; integration-browser decrypt -v $npm_package_config_localTestVectors --karma -c cpu" ,
33
33
"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" ,
34
34
"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 " ,
37
37
"node-integration" : " run-s integration-node-*" ,
38
38
"integration" : " run-s integration-*" ,
39
39
"test_conditions" : " ./util/test_conditions"
You can’t perform that action at this time.
0 commit comments