Skip to content

[9.2] [CI] Filter empty jest tests before grouping (#242440)#263133

Closed
dmlemeshko wants to merge 1 commit into
elastic:9.2from
dmlemeshko:backport/9.2/pr-242440
Closed

[9.2] [CI] Filter empty jest tests before grouping (#242440)#263133
dmlemeshko wants to merge 1 commit into
elastic:9.2from
dmlemeshko:backport/9.2/pr-242440

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.2:

Questions ?

Please refer to the Backport tool documentation

## Summary
It seems the jest unit test grouping through `ci-stats` is broken. It's
probably because we no longer run and report empty test configs (after
elastic#236549 we skip empty configs),
thus CI stats will no longer be able to have an accurate guess as to how
long they will take. Calculating with the default guessed config
runtimes results in weird buckets. We went from ~23 jest unit test
groups to ~53 (again, probably because the empty configs, that would run
in a few seconds are counted as if they take a few minutes + overhead).

This PR updates the `pick_test_group_run_order` logic, such that we no
longer ask grouping for the configs that don't contain any test files to
run. The result reset the jest unit parallel group count back to 23.

For this, I'm using jest's internal utilities to search for test files,
and had to bootstrap the step, so that the resolution doesn't break.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 4889045)

# Conflicts:
#	.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts
#	.buildkite/pipeline-utils/scout/index.ts
#	.buildkite/pipeline-utils/scout/pick_scout_test_group_run_order.ts
#	.buildkite/pipelines/fips/fips_pipeline.ts
#	.buildkite/scripts/steps/test/pick_test_group_run_order.sh
#	src/platform/packages/shared/kbn-test-saml-auth/jest.config.js
@dmlemeshko dmlemeshko added the backport This PR is a backport of another PR label Apr 14, 2026
@dmlemeshko dmlemeshko enabled auto-merge (squash) April 14, 2026 16:02
@dmlemeshko dmlemeshko requested a review from a team April 14, 2026 16:02
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 14, 2026

@dmlemeshko dmlemeshko closed this Apr 15, 2026
auto-merge was automatically disabled April 15, 2026 14:22

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants