Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
  • Loading branch information
Tyler Smalley committed Oct 20, 2021
1 parent 1a5570b commit 15cd15b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ steps:

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
parallelism: 4
agents:
queue: c2-16
queue: n2-4
timeout_in_minutes: 120
key: jest

Expand Down
3 changes: 2 additions & 1 deletion .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ steps:

- command: .buildkite/scripts/steps/test/jest.sh
label: 'Jest Tests'
parallelism: 5
agents:
queue: c2-16
queue: n2-4
timeout_in_minutes: 120
key: jest

Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/test/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ is_test_execution_step
.buildkite/scripts/bootstrap.sh

echo '--- Jest'
checks-reporter-with-killswitch "Jest Unit Tests" \
node scripts/jest --ci --verbose --maxWorkers=10
checks-reporter-with-killswitch "Jest Unit Tests $((BUILDKITE_PARALLEL_JOB+1))" \
.buildkite/scripts/steps/test/jest_parallel.sh
14 changes: 14 additions & 0 deletions .buildkite/scripts/steps/test/jest_parallel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

JOB=$BUILDKITE_PARALLEL_JOB
JOB_COUNT=$BUILDKITE_PARALLEL_JOB_COUNT

i=0
find src x-pack packages -name jest.config.js | sort | while read config; do
if [ "$(($i % $JOB_COUNT))" -eq $JOB ]; then
echo "--- $ node scripts/jest --config $config"
node scripts/jest --config $config
fi

((i=i+1))
done
10 changes: 9 additions & 1 deletion packages/kbn-test/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ module.exports = {
modulePathIgnorePatterns: ['__fixtures__/', 'target/'],

// 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
setupFiles: [
Expand Down

0 comments on commit 15cd15b

Please sign in to comment.