Skip to content

Commit

Permalink
Add grep arg
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Nov 3, 2021
1 parent a3f6e70 commit 7d2db2c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
13 changes: 11 additions & 2 deletions x-pack/plugins/apm/scripts/test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ const { argv } = yargs(process.argv.slice(2))
description:
'Run all tests (an instance of Elasticsearch and kibana are needs to be available)',
})
.option('grep', {
alias: 'spec',
default: false,
type: 'string',
description: 'Specify the spec files to run',
})
.help();

const { trial, server, runner } = argv;
const { trial, server, runner, grep } = argv;

const license = trial ? 'trial' : 'basic';
console.log(`License: ${license}`);
Expand All @@ -46,7 +52,10 @@ if (server) {
} else if (runner) {
ftrScript = 'functional_test_runner';
}

const grepArg = grep ? `--grep ${grep}` : '';

childProcess.execSync(
`node ../../../../scripts/${ftrScript} --config ../../../../test/apm_api_integration/${license}/config.ts`,
`node ../../../../scripts/${ftrScript} ${grepArg} --config ../../../../test/apm_api_integration/${license}/config.ts`,
{ cwd: path.join(__dirname), stdio: 'inherit' }
);
7 changes: 4 additions & 3 deletions x-pack/plugins/apm/scripts/test/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const { argv } = yargs(process.argv.slice(2))
description:
'Run all tests (an instance of Elasticsearch and kibana are needs to be available)',
})
.option('spec', {
.option('grep', {
alias: 'spec',
default: false,
type: 'string',
description:
Expand All @@ -46,7 +47,7 @@ const { argv } = yargs(process.argv.slice(2))
})
.help();

const { server, runner, open, spec, bail, kibanaInstallDir } = argv;
const { server, runner, open, grep, bail, kibanaInstallDir } = argv;

const e2eDir = path.join(__dirname, '../../ftr_e2e');

Expand All @@ -58,7 +59,7 @@ if (server) {
}

const config = open ? './ftr_config_open.ts' : './ftr_config_run.ts';
const grepArg = spec ? `--grep ${spec}` : '';
const grepArg = grep ? `--grep ${grep}` : '';
const bailArg = bail ? `--bail` : '';

childProcess.execSync(
Expand Down

0 comments on commit 7d2db2c

Please sign in to comment.