-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Exceptions][API testing] Refactor commands in pac…
…kage.json (#170025) ## Summary - Refactor package.json to remove duplicates - Move the new term rules
- Loading branch information
Showing
6 changed files
with
138 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
x-pack/test/security_solution_api_integration/scripts/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
const { spawn } = require('child_process'); | ||
|
||
const [ | ||
, | ||
, | ||
type, | ||
folder, | ||
projectType, | ||
environment, | ||
area = 'detections_response', | ||
licenseFolder = 'default_license', | ||
...args | ||
] = process.argv; | ||
|
||
const configPath = `./test_suites/${area}/${licenseFolder}/${folder}/configs/${projectType}.config.ts`; | ||
|
||
const command = | ||
type === 'server' | ||
? '../../scripts/functional_tests_server.js' | ||
: '../../scripts/functional_test_runner'; | ||
|
||
let grepArgs = []; | ||
|
||
if (type !== 'server') { | ||
switch (environment) { | ||
case 'serverlessEnv': | ||
grepArgs = ['--grep', '@serverless', '--grep', '@brokenInServerless', '--invert']; | ||
break; | ||
|
||
case 'essEnv': | ||
grepArgs = ['--grep', '@ess']; | ||
break; | ||
|
||
case 'qaEnv': | ||
grepArgs = ['--grep', '@serverless', '--grep', '@brokenInServerless|@skipInQA', '--invert']; | ||
break; | ||
|
||
default: | ||
console.error(`Unsupported environment: ${environment}`); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
const child = spawn('node', [command, '--config', configPath, ...grepArgs, ...args], { | ||
stdio: 'inherit', | ||
}); | ||
|
||
child.on('close', (code) => { | ||
console.log(`child process exited with code ${code}`); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters