Skip to content

Commit 580f94b

Browse files
authored
[9.1] [ci] fix flaky-test-runner reporter for scout/synthetics (#236616) (#237662)
# Backport This will backport the following commits from `main` to `9.1`: - [[ci] fix flaky-test-runner reporter for scout/synthetics (#236616)](#236616) <!--- Backport version: 10.0.2 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2025-09-26T19:46:53Z","message":"[ci] fix flaky-test-runner reporter for scout/synthetics (#236616)\n\n## Summary\n\nWe saw `🎉 All tests passed!` reported for Scout tests, even when they\nfailed. This PR adjusts `post_stats_on_pr.ts` to properly handle Scout\ntests (Synthetics as well?)","sha":"ffdbdc23088daebdf99dfc1f161a8c66d7725bb0","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport missing","backport:all-open","test:scout","v9.2.0"],"title":"[ci] fix flaky-test-runner reporter for scout/synthetics","number":236616,"url":"https://github.com/elastic/kibana/pull/236616","mergeCommit":{"message":"[ci] fix flaky-test-runner reporter for scout/synthetics (#236616)\n\n## Summary\n\nWe saw `🎉 All tests passed!` reported for Scout tests, even when they\nfailed. This PR adjusts `post_stats_on_pr.ts` to properly handle Scout\ntests (Synthetics as well?)","sha":"ffdbdc23088daebdf99dfc1f161a8c66d7725bb0"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/236616","number":236616,"mergeCommit":{"message":"[ci] fix flaky-test-runner reporter for scout/synthetics (#236616)\n\n## Summary\n\nWe saw `🎉 All tests passed!` reported for Scout tests, even when they\nfailed. This PR adjusts `post_stats_on_pr.ts` to properly handle Scout\ntests (Synthetics as well?)","sha":"ffdbdc23088daebdf99dfc1f161a8c66d7725bb0"}}]}] BACKPORT-->
1 parent 82e93d4 commit 580f94b

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
export enum TestSuiteType {
11+
FTR = 'ftr-suite',
12+
SCOUT = 'scout-suite',
13+
CYPRESS = 'cypress-suite',
14+
SYNTHETICS = 'synthetics-suite',
15+
}
16+
17+
export const TEST_SUITE_TYPES = Object.values(TestSuiteType);

.buildkite/pipelines/flaky_tests/pipeline.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
*/
99

1010
import { groups } from './groups.json';
11-
import { BuildkiteStep, expandAgentQueue, collectEnvFromLabels } from '#pipeline-utils';
11+
import { TestSuiteType } from './constants';
12+
import type { BuildkiteStep } from '#pipeline-utils';
13+
import { expandAgentQueue, collectEnvFromLabels } from '#pipeline-utils';
1214

1315
const configJson = process.env.KIBANA_FLAKY_TEST_RUNNER_CONFIG;
1416
if (!configJson) {
@@ -170,7 +172,7 @@ for (const testSuite of testSuites) {
170172
env: {
171173
FTR_CONFIG: testSuite.ftrConfig,
172174
},
173-
key: `ftr-suite-${suiteIndex++}`,
175+
key: `${TestSuiteType.FTR}-${suiteIndex++}`,
174176
label: `${testSuite.ftrConfig}`,
175177
parallelism: testSuite.count,
176178
concurrency,
@@ -197,7 +199,7 @@ for (const testSuite of testSuites) {
197199
SCOUT_CONFIG: testSuite.scoutConfig,
198200
SCOUT_CONFIG_GROUP_TYPE: scoutConfigGroupType!,
199201
},
200-
key: `scout-suite-${suiteIndex++}`,
202+
key: `${TestSuiteType.SCOUT}-${suiteIndex++}`,
201203
label: `${testSuite.scoutConfig}`,
202204
parallelism: testSuite.count,
203205
concurrency,
@@ -228,7 +230,7 @@ for (const testSuite of testSuites) {
228230
command: `.buildkite/scripts/steps/functional/${suiteName}.sh`,
229231
label: group.name,
230232
agents: expandAgentQueue(agentQueue),
231-
key: `cypress-suite-${suiteIndex++}`,
233+
key: `${TestSuiteType.CYPRESS}-${suiteIndex++}`,
232234
depends_on: 'build',
233235
timeout_in_minutes: 150,
234236
parallelism: testSuite.count,
@@ -261,7 +263,7 @@ for (const testSuite of testSuites) {
261263
command: `.buildkite/scripts/steps/functional/${suiteName}.sh`,
262264
label: synthGroup.name,
263265
agents: expandAgentQueue('n2-4-spot'),
264-
key: `synthetics-suite-${suiteIndex++}`,
266+
key: `${TestSuiteType.SYNTHETICS}-${suiteIndex++}`,
265267
depends_on: 'build',
266268
timeout_in_minutes: 30,
267269
parallelism: testSuite.count,

.buildkite/pipelines/flaky_tests/post_stats_on_pr.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10+
import { TEST_SUITE_TYPES } from './constants';
1011
import { BuildkiteClient, getGithubClient } from '#pipeline-utils';
1112

1213
interface TestSuiteResult {
@@ -28,7 +29,7 @@ async function main() {
2829
// Calculate success metrics
2930
const jobs = buildkiteBuild.jobs;
3031
const testSuiteRuns = jobs.filter((step) => {
31-
return step.step_key?.includes('ftr-suite') || step.step_key?.includes('cypress-suite');
32+
return TEST_SUITE_TYPES.some((testType) => step.step_key?.includes(testType));
3233
});
3334
const testSuiteGroups = groupBy('name', testSuiteRuns);
3435

0 commit comments

Comments
 (0)