Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Jest configuration #125727

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ steps:

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 2
agents:
queue: n2-4
timeout_in_minutes: 120
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/code_coverage/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ is_test_execution_step

echo '--- Jest code coverage'

.buildkite/scripts/steps/code_coverage/jest_parallel.sh
.buildkite/scripts/steps/code_coverage/jest_parallel.sh jest.config.js

tar -czf kibana-jest-thread-coverage.tar.gz target/kibana-coverage/jest

echo "--- Merging code coverage for a thread"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js --reporter json
rm -rf target/kibana-coverage/jest/*
mv target/kibana-coverage/jest-combined/coverage-final.json "target/kibana-coverage/jest/jest-merged-coverage-$(date +%s%3N).json"
mv target/kibana-coverage/jest-combined/coverage-final.json "target/kibana-coverage/jest/jest-merged-coverage-$(date +%s%3N).json"
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/test/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ is_test_execution_step

echo '--- Jest'
checks-reporter-with-killswitch "Jest Unit Tests $((BUILDKITE_PARALLEL_JOB+1))" \
.buildkite/scripts/steps/test/jest_parallel.sh
.buildkite/scripts/steps/test/jest_parallel.sh jest.config.js
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/test/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ while read -r config; do

((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 ${1:-jest.config.js} -not -path "*/__fixtures__/*" | sort)"
done <<< "$(find src x-pack packages -name "$1" -not -path "*/__fixtures__/*" | sort)"

exit $exitCode
27 changes: 0 additions & 27 deletions jest.config.integration.js

This file was deleted.

24 changes: 0 additions & 24 deletions jest.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/kbn-test/src/jest/run_check_jest_configs_cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { writeFileSync } from 'fs';
import path from 'path';
import Mustache from 'mustache';

import { run } from '@kbn/dev-utils';
import { run, createFailError } from '@kbn/dev-utils';
import { REPO_ROOT } from '@kbn/utils';

import { JestConfigs, CONFIG_NAMES } from './configs';
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function runCheckJestConfigsCli() {
log.info('created %s', file);
});
} else {
log.info(
throw createFailError(
`Run 'node scripts/check_jest_configs --fix' to create the missing config files`
);
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/jest_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
require('../src/setup_node_env/ensure_node_preserve_symlinks');
process.argv.push('--runInBand');

require('@kbn/test').runJest('jest.config.integration.js');
require('@kbn/test').runJest('jest.integration.config.js');