Skip to content

Commit

Permalink
[CI] Balance/split CI groups and remove docker-specific group (#130181)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders authored Apr 14, 2022
1 parent 6adc94b commit 1dce1d8
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 76 deletions.
14 changes: 1 addition & 13 deletions .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ steps:

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
parallelism: 27
parallelism: 29
agents:
queue: n2-4
depends_on: build
Expand All @@ -40,18 +40,6 @@ steps:
- exit_status: '*'
limit: 1

- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Docker CI Group'
agents:
queue: n2-4
depends_on: build
timeout_in_minutes: 120
key: default-cigroup-docker
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
label: 'OSS CI Group'
parallelism: 11
Expand Down
8 changes: 2 additions & 6 deletions .buildkite/pipelines/flaky_tests/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@
{
"key": "xpack/cigroup",
"name": "Default CI Group",
"ciGroups": 27
},
{
"key": "xpack/cigroup/Docker",
"name": "Default CI Group Docker"
"ciGroups": 29
},
{
"key": "xpack/firefox",
Expand All @@ -47,4 +43,4 @@
"name": "Default Accessibility"
}
]
}
}
16 changes: 1 addition & 15 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ steps:

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
parallelism: 27
parallelism: 29
agents:
queue: n2-4-spot
depends_on: build
Expand All @@ -64,20 +64,6 @@ steps:
- exit_status: '*'
limit: 1

- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Docker CI Group'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
key: default-cigroup-docker
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
label: 'OSS CI Group'
parallelism: 11
Expand Down
14 changes: 1 addition & 13 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:

- command: .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Default CI Group'
parallelism: 27
parallelism: 29
agents:
queue: n2-4
depends_on: build
Expand All @@ -28,18 +28,6 @@ steps:
- exit_status: '*'
limit: 1

- command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh
label: 'Docker CI Group'
agents:
queue: n2-4
depends_on: build
timeout_in_minutes: 120
key: default-cigroup-docker
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/oss_cigroup.sh
label: 'OSS CI Group'
parallelism: 11
Expand Down
3 changes: 2 additions & 1 deletion .ci/ci_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ xpack:
- ciGroup25
- ciGroup26
- ciGroup27
- ciGroupDocker
- ciGroup28
- ciGroup29
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,7 @@ import { createAssignmentProxy } from './assignment_proxy';
import { wrapFunction } from './wrap_function';
import { wrapRunnableArgs } from './wrap_runnable_args';

function split(arr, fn) {
const a = [];
const b = [];
for (const i of arr) {
(fn(i) ? a : b).push(i);
}
return [a, b];
}

export function decorateMochaUi(log, lifecycle, context, { isDockerGroup, rootTags }) {
export function decorateMochaUi(log, lifecycle, context, { rootTags }) {
// incremented at the start of each suite, decremented after
// so that in each non-suite call we can know if we are within
// a suite, or that when a suite is defined it is within a suite
Expand Down Expand Up @@ -63,25 +54,15 @@ export function decorateMochaUi(log, lifecycle, context, { isDockerGroup, rootTa

const relativeFilePath = relative(REPO_ROOT, this.file);
this._tags = [
...(isDockerGroup ? ['ciGroupDocker', relativeFilePath] : [relativeFilePath]),
relativeFilePath,
// we attach the "root tags" to all the child suites of the root suite, so that if they
// need to be excluded they can be removed from the root suite without removing the entire
// root suite
...(this.parent.root ? [...(rootTags ?? [])] : []),
];
this.suiteTag = relativeFilePath; // The tag that uniquely targets this suite/file
this.tags = (tags) => {
const newTags = Array.isArray(tags) ? tags : [tags];
const [tagsToAdd, tagsToIgnore] = split(newTags, (t) =>
!isDockerGroup ? true : !t.startsWith('ciGroup')
);

if (tagsToIgnore.length) {
log.warning(
`ignoring ciGroup tags because test is being run by a config using 'dockerServers', tags: ${tagsToIgnore}`
);
}

const tagsToAdd = Array.isArray(tags) ? tags : [tags];
this._tags = [...this._tags, ...tagsToAdd];
};
this.onlyEsVersion = (semver) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FtrProviderContext } from '../../../common/ftr_provider_context';
export default ({ loadTestFile }: FtrProviderContext): void => {
describe('Detection rule type telemetry', function () {
describe('', function () {
this.tags('ciGroup11');
this.tags('ciGroup28');
loadTestFile(require.resolve('./usage_collector/all_types'));
loadTestFile(require.resolve('./usage_collector/detection_rules'));
loadTestFile(require.resolve('./usage_collector/detection_rule_status'));
Expand Down
2 changes: 2 additions & 0 deletions x-pack/test/fleet_api_integration/apis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { setupTestUsers } from './test_users';

export default function ({ loadTestFile, getService }) {
describe('Fleet Endpoints', function () {
this.tags('ciGroup29');

before(async () => {
await setupTestUsers(getService('security'));
});
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional_synthetics/apps/uptime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';

export default ({ loadTestFile, getService }: FtrProviderContext) => {
describe('Uptime app', function () {
this.tags('ciGroup8');
describe('with generated data', () => {
loadTestFile(require.resolve('./synthetics_integration'));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid
const searchSessions = getService('searchSessions');

describe('Dashboard', function () {
this.tags('ciGroup3');
this.tags('ciGroup5');

before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid
const PageObjects = getPageObjects(['common']);

describe('Search session sharing', function () {
this.tags('ciGroup3');
this.tags('ciGroup5');

before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ({ loadTestFile, getService, getPageObjects }: FtrProvid
const searchSessions = getService('searchSessions');

describe('Discover', function () {
this.tags('ciGroup3');
this.tags('ciGroup5');

before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

describe('lens search sessions', function () {
this.tags('ciGroup3');
this.tags('ciGroup5');

before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ({ loadTestFile, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');

describe('search sessions management', function () {
this.tags('ciGroup3');
this.tags('ciGroup5');

before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function (providerContext: FtrProviderContext) {
const { loadTestFile, getService } = providerContext;

describe('endpoint', function () {
this.tags('ciGroup7');
const ingestManager = getService('ingestManager');
const log = getService('log');
const endpointTestResources = getService('endpointTestResources');
Expand Down
2 changes: 2 additions & 0 deletions x-pack/test/security_solution_endpoint_api_int/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default function endpointAPIIntegrationTests(providerContext: FtrProvider
const { loadTestFile, getService } = providerContext;

describe('Endpoint plugin', function () {
this.tags('ciGroup9');

const ingestManager = getService('ingestManager');

const log = getService('log');
Expand Down

0 comments on commit 1dce1d8

Please sign in to comment.