|
@@ -12,12 +12,7 @@ const args = process.argv.slice(2);
|
|
let config, report;
|
|
let config, report;
|
|
|
|
|
|
try {
|
|
try {
|
|
- ({ values: {
|
|
|
|
- config,
|
|
|
|
- report,
|
|
|
|
- bench,
|
|
|
|
- unit,
|
|
|
|
- }, positionals: [id] } = parseArgs({
|
|
|
|
|
|
+ const parsed = parseArgs({
|
|
options: {
|
|
options: {
|
|
config: {
|
|
config: {
|
|
type: 'string',
|
|
type: 'string',
|
|
@@ -25,31 +20,45 @@ try {
|
|
report: {
|
|
report: {
|
|
type: 'string',
|
|
type: 'string',
|
|
},
|
|
},
|
|
|
|
+ onlycase: { type: 'string' },
|
|
bench: { type: 'boolean' },
|
|
bench: { type: 'boolean' },
|
|
unit: { type: 'boolean' },
|
|
unit: { type: 'boolean' },
|
|
},
|
|
},
|
|
allowPositionals: true,
|
|
allowPositionals: true,
|
|
- }));
|
|
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ ({ values: {
|
|
|
|
+ config,
|
|
|
|
+ report,
|
|
|
|
+ onlycase,
|
|
|
|
+ bench,
|
|
|
|
+ unit,
|
|
|
|
+ }, positionals: [id] } = parsed);
|
|
|
|
+
|
|
|
|
+ onlycase = Number.parseInt(onlycase);
|
|
} catch (e) {
|
|
} catch (e) {
|
|
- if ( args.length < 1 ) {
|
|
|
|
- console.error(
|
|
|
|
- 'Usage: apitest [OPTIONS]\n' +
|
|
|
|
- '\n' +
|
|
|
|
- 'Options:\n' +
|
|
|
|
- ' --config=<path> (required) Path to configuration file\n' +
|
|
|
|
- ' --report=<path> (optional) Output file for full test results\n' +
|
|
|
|
- ''
|
|
|
|
- );
|
|
|
|
- process.exit(1);
|
|
|
|
- }
|
|
|
|
|
|
+ console.error(e);
|
|
|
|
+ console.error(
|
|
|
|
+ 'Usage: apitest [OPTIONS]\n' +
|
|
|
|
+ '\n' +
|
|
|
|
+ 'Options:\n' +
|
|
|
|
+ ' --config=<path> (required) Path to configuration file\n' +
|
|
|
|
+ ' --report=<path> (optional) Output file for full test results\n' +
|
|
|
|
+ ''
|
|
|
|
+ );
|
|
|
|
+ process.exit(1);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
const conf = YAML.parse(fs.readFileSync(config).toString());
|
|
const conf = YAML.parse(fs.readFileSync(config).toString());
|
|
|
|
|
|
|
|
|
|
const main = async () => {
|
|
const main = async () => {
|
|
- const ts = new TestSDK(conf);
|
|
|
|
|
|
+ const context = {
|
|
|
|
+ options: {
|
|
|
|
+ onlycase,
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ const ts = new TestSDK(conf, context);
|
|
try {
|
|
try {
|
|
await ts.delete('api_test', { recursive: true });
|
|
await ts.delete('api_test', { recursive: true });
|
|
} catch (e) {
|
|
} catch (e) {
|