mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[ci] Run Jest tests in parallel (#117188)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This commit is contained in:
parent
195e5bebcb
commit
139a3c9866
39 changed files with 420 additions and 113 deletions
|
@ -119,6 +119,14 @@ steps:
|
||||||
- exit_status: '*'
|
- exit_status: '*'
|
||||||
limit: 1
|
limit: 1
|
||||||
|
|
||||||
|
- command: .buildkite/scripts/steps/test/jest.sh
|
||||||
|
label: 'Jest Tests'
|
||||||
|
parallelism: 8
|
||||||
|
agents:
|
||||||
|
queue: n2-4
|
||||||
|
timeout_in_minutes: 90
|
||||||
|
key: jest
|
||||||
|
|
||||||
- command: .buildkite/scripts/steps/test/jest_integration.sh
|
- command: .buildkite/scripts/steps/test/jest_integration.sh
|
||||||
label: 'Jest Integration Tests'
|
label: 'Jest Integration Tests'
|
||||||
agents:
|
agents:
|
||||||
|
@ -133,13 +141,6 @@ steps:
|
||||||
timeout_in_minutes: 120
|
timeout_in_minutes: 120
|
||||||
key: api-integration
|
key: api-integration
|
||||||
|
|
||||||
- command: .buildkite/scripts/steps/test/jest.sh
|
|
||||||
label: 'Jest Tests'
|
|
||||||
agents:
|
|
||||||
queue: c2-16
|
|
||||||
timeout_in_minutes: 120
|
|
||||||
key: jest
|
|
||||||
|
|
||||||
- command: .buildkite/scripts/steps/lint.sh
|
- command: .buildkite/scripts/steps/lint.sh
|
||||||
label: 'Linting'
|
label: 'Linting'
|
||||||
agents:
|
agents:
|
||||||
|
|
|
@ -117,6 +117,14 @@ steps:
|
||||||
- exit_status: '*'
|
- exit_status: '*'
|
||||||
limit: 1
|
limit: 1
|
||||||
|
|
||||||
|
- command: .buildkite/scripts/steps/test/jest.sh
|
||||||
|
label: 'Jest Tests'
|
||||||
|
parallelism: 8
|
||||||
|
agents:
|
||||||
|
queue: n2-4
|
||||||
|
timeout_in_minutes: 90
|
||||||
|
key: jest
|
||||||
|
|
||||||
- command: .buildkite/scripts/steps/test/jest_integration.sh
|
- command: .buildkite/scripts/steps/test/jest_integration.sh
|
||||||
label: 'Jest Integration Tests'
|
label: 'Jest Integration Tests'
|
||||||
agents:
|
agents:
|
||||||
|
@ -131,13 +139,6 @@ steps:
|
||||||
timeout_in_minutes: 120
|
timeout_in_minutes: 120
|
||||||
key: api-integration
|
key: api-integration
|
||||||
|
|
||||||
- command: .buildkite/scripts/steps/test/jest.sh
|
|
||||||
label: 'Jest Tests'
|
|
||||||
agents:
|
|
||||||
queue: c2-16
|
|
||||||
timeout_in_minutes: 120
|
|
||||||
key: jest
|
|
||||||
|
|
||||||
- command: .buildkite/scripts/steps/lint.sh
|
- command: .buildkite/scripts/steps/lint.sh
|
||||||
label: 'Linting'
|
label: 'Linting'
|
||||||
agents:
|
agents:
|
||||||
|
|
|
@ -9,5 +9,5 @@ is_test_execution_step
|
||||||
.buildkite/scripts/bootstrap.sh
|
.buildkite/scripts/bootstrap.sh
|
||||||
|
|
||||||
echo '--- Jest'
|
echo '--- Jest'
|
||||||
checks-reporter-with-killswitch "Jest Unit Tests" \
|
checks-reporter-with-killswitch "Jest Unit Tests $((BUILDKITE_PARALLEL_JOB+1))" \
|
||||||
node scripts/jest --ci --verbose --maxWorkers=10
|
.buildkite/scripts/steps/test/jest_parallel.sh
|
||||||
|
|
30
.buildkite/scripts/steps/test/jest_parallel.sh
Executable file
30
.buildkite/scripts/steps/test/jest_parallel.sh
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -uo pipefail
|
||||||
|
|
||||||
|
JOB=$BUILDKITE_PARALLEL_JOB
|
||||||
|
JOB_COUNT=$BUILDKITE_PARALLEL_JOB_COUNT
|
||||||
|
|
||||||
|
# a jest failure will result in the script returning an exit code of 10
|
||||||
|
|
||||||
|
i=0
|
||||||
|
exitCode=0
|
||||||
|
|
||||||
|
while read -r config; do
|
||||||
|
if [ "$((i % JOB_COUNT))" -eq "$JOB" ]; then
|
||||||
|
echo "--- $ node scripts/jest --config $config"
|
||||||
|
node --max-old-space-size=14336 ./node_modules/.bin/jest --config="$config" --runInBand --coverage=false
|
||||||
|
lastCode=$?
|
||||||
|
|
||||||
|
if [ $lastCode -ne 0 ]; then
|
||||||
|
exitCode=10
|
||||||
|
echo "Jest exited with code $lastCode"
|
||||||
|
echo "^^^ +++"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
((i=i+1))
|
||||||
|
# uses heredoc to avoid the while loop being in a sub-shell thus unable to overwrite exitCode
|
||||||
|
done <<< "$(find src x-pack packages -name jest.config.js -not -path "*/__fixtures__/*" | sort)"
|
||||||
|
|
||||||
|
exit $exitCode
|
|
@ -704,6 +704,7 @@ module.exports = {
|
||||||
'packages/kbn-eslint-plugin-eslint/**/*',
|
'packages/kbn-eslint-plugin-eslint/**/*',
|
||||||
'x-pack/gulpfile.js',
|
'x-pack/gulpfile.js',
|
||||||
'x-pack/scripts/*.js',
|
'x-pack/scripts/*.js',
|
||||||
|
'**/jest.config.js',
|
||||||
],
|
],
|
||||||
excludedFiles: ['**/integration_tests/**/*'],
|
excludedFiles: ['**/integration_tests/**/*'],
|
||||||
rules: {
|
rules: {
|
||||||
|
|
|
@ -17,5 +17,8 @@ module.exports = {
|
||||||
'<rootDir>/src/plugins/vis_types/*/jest.config.js',
|
'<rootDir>/src/plugins/vis_types/*/jest.config.js',
|
||||||
'<rootDir>/test/*/jest.config.js',
|
'<rootDir>/test/*/jest.config.js',
|
||||||
'<rootDir>/x-pack/plugins/*/jest.config.js',
|
'<rootDir>/x-pack/plugins/*/jest.config.js',
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/*/jest.config.js',
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/public/*/jest.config.js',
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/server/*/jest.config.js',
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -79,6 +79,7 @@ expect.addSnapshotSerializer(extendedEnvSerializer);
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
log.messages.length = 0;
|
log.messages.length = 0;
|
||||||
|
process.execArgv = ['--inheritted', '--exec', '--argv'];
|
||||||
currentProc = undefined;
|
currentProc = undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -138,8 +139,9 @@ describe('#run$', () => {
|
||||||
"isDevCliChild": "true",
|
"isDevCliChild": "true",
|
||||||
},
|
},
|
||||||
"nodeOptions": Array [
|
"nodeOptions": Array [
|
||||||
"--preserve-symlinks-main",
|
"--inheritted",
|
||||||
"--preserve-symlinks",
|
"--exec",
|
||||||
|
"--argv",
|
||||||
],
|
],
|
||||||
"stdio": "pipe",
|
"stdio": "pipe",
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
|
||||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
||||||
* Side Public License, v 1.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preset: '@kbn/test',
|
|
||||||
rootDir: '../..',
|
|
||||||
roots: ['<rootDir>/packages/kbn-rule-data-utils'],
|
|
||||||
};
|
|
|
@ -1,13 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
|
||||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
||||||
* Side Public License, v 1.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preset: '@kbn/test',
|
|
||||||
rootDir: '../..',
|
|
||||||
roots: ['<rootDir>/packages/kbn-securitysolution-list-constants'],
|
|
||||||
};
|
|
|
@ -1,13 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
|
||||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
||||||
* Side Public License, v 1.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preset: '@kbn/test',
|
|
||||||
rootDir: '../..',
|
|
||||||
roots: ['<rootDir>/packages/kbn-securitysolution-rules'],
|
|
||||||
};
|
|
|
@ -1,13 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
|
||||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
||||||
* Side Public License, v 1.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preset: '@kbn/test',
|
|
||||||
rootDir: '../..',
|
|
||||||
roots: ['<rootDir>/packages/kbn-securitysolution-t-grid'],
|
|
||||||
};
|
|
|
@ -46,7 +46,15 @@ module.exports = {
|
||||||
modulePathIgnorePatterns: ['__fixtures__/', 'target/'],
|
modulePathIgnorePatterns: ['__fixtures__/', 'target/'],
|
||||||
|
|
||||||
// Use this configuration option to add custom reporters to Jest
|
// Use this configuration option to add custom reporters to Jest
|
||||||
reporters: ['default', '@kbn/test/target_node/jest/junit_reporter'],
|
reporters: [
|
||||||
|
'default',
|
||||||
|
[
|
||||||
|
'@kbn/test/target_node/jest/junit_reporter',
|
||||||
|
{
|
||||||
|
rootDirectory: '.',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
// The paths to modules that run some code to configure or set up the testing environment before each test
|
// The paths to modules that run some code to configure or set up the testing environment before each test
|
||||||
setupFiles: [
|
setupFiles: [
|
||||||
|
|
|
@ -52,11 +52,12 @@ export function runJest(configName = 'jest.config.js') {
|
||||||
|
|
||||||
const runStartTime = Date.now();
|
const runStartTime = Date.now();
|
||||||
const reportTime = getTimeReporter(log, 'scripts/jest');
|
const reportTime = getTimeReporter(log, 'scripts/jest');
|
||||||
let cwd: string;
|
|
||||||
let testFiles: string[];
|
let testFiles: string[];
|
||||||
|
|
||||||
|
const cwd: string = process.env.INIT_CWD || process.cwd();
|
||||||
|
|
||||||
if (!argv.config) {
|
if (!argv.config) {
|
||||||
cwd = process.env.INIT_CWD || process.cwd();
|
|
||||||
testFiles = argv._.splice(2).map((p) => resolve(cwd, p));
|
testFiles = argv._.splice(2).map((p) => resolve(cwd, p));
|
||||||
const commonTestFiles = commonBasePath(testFiles);
|
const commonTestFiles = commonBasePath(testFiles);
|
||||||
const testFilesProvided = testFiles.length > 0;
|
const testFilesProvided = testFiles.length > 0;
|
||||||
|
|
|
@ -26,7 +26,16 @@ const template: string = `module.exports = {
|
||||||
};
|
};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const roots: string[] = ['x-pack/plugins', 'packages', 'src/plugins', 'test', 'src'];
|
const roots: string[] = [
|
||||||
|
'x-pack/plugins/security_solution/public',
|
||||||
|
'x-pack/plugins/security_solution/server',
|
||||||
|
'x-pack/plugins/security_solution',
|
||||||
|
'x-pack/plugins',
|
||||||
|
'packages',
|
||||||
|
'src/plugins',
|
||||||
|
'test',
|
||||||
|
'src',
|
||||||
|
];
|
||||||
|
|
||||||
export async function runCheckJestConfigsCli() {
|
export async function runCheckJestConfigsCli() {
|
||||||
run(
|
run(
|
||||||
|
@ -76,7 +85,9 @@ export async function runCheckJestConfigsCli() {
|
||||||
modulePath,
|
modulePath,
|
||||||
});
|
});
|
||||||
|
|
||||||
writeFileSync(resolve(root, name, 'jest.config.js'), content);
|
const configPath = resolve(root, name, 'jest.config.js');
|
||||||
|
log.info('created %s', configPath);
|
||||||
|
writeFileSync(configPath, content);
|
||||||
} else {
|
} else {
|
||||||
log.warning(`Unable to determind where to place jest.config.js for ${file}`);
|
log.warning(`Unable to determind where to place jest.config.js for ${file}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
/*
|
|
||||||
* 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 and the Server Side Public License, v 1; you may not use this file except
|
|
||||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
||||||
* Side Public License, v 1.
|
|
||||||
*/
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preset: '@kbn/test',
|
|
||||||
rootDir: '../../..',
|
|
||||||
roots: ['<rootDir>/src/plugins/expression_error'],
|
|
||||||
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/src/plugins/expression_error',
|
|
||||||
coverageReporters: ['text', 'html'],
|
|
||||||
collectCoverageFrom: ['<rootDir>/src/plugins/expression_error/{common,public}/**/*.{ts,tsx}'],
|
|
||||||
};
|
|
|
@ -17,7 +17,8 @@ import { LevelLogger } from '../../lib';
|
||||||
jest.mock('./checksum');
|
jest.mock('./checksum');
|
||||||
jest.mock('./download');
|
jest.mock('./download');
|
||||||
|
|
||||||
describe('ensureBrowserDownloaded', () => {
|
// https://github.com/elastic/kibana/issues/115881
|
||||||
|
describe.skip('ensureBrowserDownloaded', () => {
|
||||||
let logger: jest.Mocked<LevelLogger>;
|
let logger: jest.Mocked<LevelLogger>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|
|
@ -24,7 +24,8 @@ import { registerDeprecationsRoutes } from './deprecations';
|
||||||
|
|
||||||
type SetupServerReturn = UnwrapPromise<ReturnType<typeof setupServer>>;
|
type SetupServerReturn = UnwrapPromise<ReturnType<typeof setupServer>>;
|
||||||
|
|
||||||
describe(`GET ${API_GET_ILM_POLICY_STATUS}`, () => {
|
// https://github.com/elastic/kibana/issues/115881
|
||||||
|
describe.skip(`GET ${API_GET_ILM_POLICY_STATUS}`, () => {
|
||||||
const reportingSymbol = Symbol('reporting');
|
const reportingSymbol = Symbol('reporting');
|
||||||
let server: SetupServerReturn['server'];
|
let server: SetupServerReturn['server'];
|
||||||
let httpSetup: SetupServerReturn['httpSetup'];
|
let httpSetup: SetupServerReturn['httpSetup'];
|
||||||
|
|
|
@ -6,10 +6,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
collectCoverageFrom: ['<rootDir>/x-pack/plugins/metrics_entities/{common,server}/**/*.{ts,tsx}'],
|
|
||||||
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/metrics_entities',
|
|
||||||
coverageReporters: ['text', 'html'],
|
|
||||||
preset: '@kbn/test',
|
preset: '@kbn/test',
|
||||||
rootDir: '../../..',
|
rootDir: '../../../..',
|
||||||
roots: ['<rootDir>/x-pack/plugins/metrics_entities'],
|
roots: ['<rootDir>/x-pack/plugins/security_solution/common'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/common',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/common/**/*.{ts,tsx}'],
|
||||||
};
|
};
|
16
x-pack/plugins/security_solution/public/app/jest.config.js
Normal file
16
x-pack/plugins/security_solution/public/app/jest.config.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/app'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/app',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/app/**/*.{ts,tsx}'],
|
||||||
|
};
|
16
x-pack/plugins/security_solution/public/cases/jest.config.js
Normal file
16
x-pack/plugins/security_solution/public/cases/jest.config.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/cases'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/cases',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/cases/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -184,7 +184,7 @@ describe('EventsViewer', () => {
|
||||||
mockUseTimelineEvents.mockReturnValue([false, mockEventViewerResponseWithEvents]);
|
mockUseTimelineEvents.mockReturnValue([false, mockEventViewerResponseWithEvents]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('call the right reduce action to show event details', () => {
|
test('call the right reduce action to show event details', async () => {
|
||||||
const wrapper = mount(
|
const wrapper = mount(
|
||||||
<TestProviders>
|
<TestProviders>
|
||||||
<StatefulEventsViewer {...testProps} />
|
<StatefulEventsViewer {...testProps} />
|
||||||
|
@ -195,19 +195,14 @@ describe('EventsViewer', () => {
|
||||||
wrapper.find(`[data-test-subj="expand-event"]`).first().simulate('click');
|
wrapper.find(`[data-test-subj="expand-event"]`).first().simulate('click');
|
||||||
});
|
});
|
||||||
|
|
||||||
waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(mockDispatch).toBeCalledTimes(2);
|
expect(mockDispatch).toBeCalledTimes(3);
|
||||||
expect(mockDispatch.mock.calls[1][0]).toEqual({
|
expect(mockDispatch.mock.calls[1][0]).toEqual({
|
||||||
payload: {
|
payload: {
|
||||||
panelView: 'eventDetail',
|
id: 'test',
|
||||||
params: {
|
isLoading: false,
|
||||||
eventId: 'yb8TkHYBRgU82_bJu_rY',
|
|
||||||
indexName: 'auditbeat-7.10.1-2020.12.18-000001',
|
|
||||||
},
|
|
||||||
tabType: 'query',
|
|
||||||
timelineId: TimelineId.test,
|
|
||||||
},
|
},
|
||||||
type: 'x-pack/security_solution/local/timeline/TOGGLE_DETAIL_PANEL',
|
type: 'x-pack/timelines/t-grid/UPDATE_LOADING',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/common'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/common',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/common/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/detections'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/detections',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/public/detections/**/*.{ts,tsx}',
|
||||||
|
],
|
||||||
|
};
|
16
x-pack/plugins/security_solution/public/hosts/jest.config.js
Normal file
16
x-pack/plugins/security_solution/public/hosts/jest.config.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/hosts'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/hosts',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/hosts/**/*.{ts,tsx}'],
|
||||||
|
};
|
18
x-pack/plugins/security_solution/public/jest.config.js
Normal file
18
x-pack/plugins/security_solution/public/jest.config.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../..',
|
||||||
|
/** all nested directories have their own Jest config file */
|
||||||
|
testMatch: ['<rootDir>/x-pack/plugins/security_solution/public/*.test.{js,mjs,ts,tsx}'],
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/management'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/management',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/public/management/**/*.{ts,tsx}',
|
||||||
|
],
|
||||||
|
};
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/network'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/network',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/network/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/overview'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/overview',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/overview/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/resolver'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/resolver',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/public/resolver/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -7,11 +7,12 @@
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
preset: '@kbn/test',
|
preset: '@kbn/test',
|
||||||
rootDir: '../../..',
|
rootDir: '../../../../..',
|
||||||
roots: ['<rootDir>/x-pack/plugins/security_solution'],
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/timelines'],
|
||||||
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution',
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/timelines',
|
||||||
coverageReporters: ['text', 'html'],
|
coverageReporters: ['text', 'html'],
|
||||||
collectCoverageFrom: [
|
collectCoverageFrom: [
|
||||||
'<rootDir>/x-pack/plugins/security_solution/{common,public,server}/**/*.{ts,tsx}',
|
'<rootDir>/x-pack/plugins/security_solution/public/timelines/**/*.{ts,tsx}',
|
||||||
],
|
],
|
||||||
};
|
};
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/public/transforms'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/public/transforms',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/public/transforms/**/*.{ts,tsx}',
|
||||||
|
],
|
||||||
|
};
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server/client'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/client',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/client/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server/endpoint'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/endpoint',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/endpoint/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server/fleet_integration'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/fleet_integration',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/server/fleet_integration/**/*.{ts,tsx}',
|
||||||
|
],
|
||||||
|
};
|
18
x-pack/plugins/security_solution/server/jest.config.js
Normal file
18
x-pack/plugins/security_solution/server/jest.config.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../..',
|
||||||
|
/** all nested directories have their own Jest config file */
|
||||||
|
testMatch: ['<rootDir>/x-pack/plugins/security_solution/server/*.test.{js,mjs,ts,tsx}'],
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/**/*.{ts,tsx}'],
|
||||||
|
};
|
16
x-pack/plugins/security_solution/server/lib/jest.config.js
Normal file
16
x-pack/plugins/security_solution/server/lib/jest.config.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server/lib'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/lib',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/lib/**/*.{ts,tsx}'],
|
||||||
|
};
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server/search_strategy'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/search_strategy',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: [
|
||||||
|
'<rootDir>/x-pack/plugins/security_solution/server/search_strategy/**/*.{ts,tsx}',
|
||||||
|
],
|
||||||
|
};
|
16
x-pack/plugins/security_solution/server/usage/jest.config.js
Normal file
16
x-pack/plugins/security_solution/server/usage/jest.config.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server/usage'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/usage',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/usage/**/*.{ts,tsx}'],
|
||||||
|
};
|
16
x-pack/plugins/security_solution/server/utils/jest.config.js
Normal file
16
x-pack/plugins/security_solution/server/utils/jest.config.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
preset: '@kbn/test',
|
||||||
|
rootDir: '../../../../..',
|
||||||
|
roots: ['<rootDir>/x-pack/plugins/security_solution/server/utils'],
|
||||||
|
coverageDirectory:
|
||||||
|
'<rootDir>/target/kibana-coverage/jest/x-pack/plugins/security_solution/server/utils',
|
||||||
|
coverageReporters: ['text', 'html'],
|
||||||
|
collectCoverageFrom: ['<rootDir>/x-pack/plugins/security_solution/server/utils/**/*.{ts,tsx}'],
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue