mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Build Kite][Code Coverage] Drop ftr_run_order.json (#151114)
## Summary As of last year we stopped supporting FTR configs in the code coverage buildkite job. While investigating a flaky test, I noticed the file's presence in the buildkite artifacts ui. This pr drops that. **Note to Reviewers:** `.buildkite/scripts/steps/test/pick_test_group_run_order.sh` is currently used in 4 places: 1. `.buildkite/pipelines/code_coverage/daily.yml` **this is where this pr is concerned** 1. `.buildkite/pipelines/pull_request/base.yml` 1. `.buildkite/pipelines/on_merge.yml` 1. `.buildkite/pipelines/es_snapshots/verify.yml` This change is small but this file is shared, so we've to keep this in mind. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
5c8bf9a94c
commit
245f385007
3 changed files with 18 additions and 38 deletions
|
@ -179,6 +179,15 @@ export async function pickTestGroupRunOrder() {
|
||||||
throw new Error(`invalid FUNCTIONAL_MAX_MINUTES: ${process.env.FUNCTIONAL_MAX_MINUTES}`);
|
throw new Error(`invalid FUNCTIONAL_MAX_MINUTES: ${process.env.FUNCTIONAL_MAX_MINUTES}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This env variable corresponds to the env stanza within
|
||||||
|
* https://github.com/elastic/kibana/blob/bc2cb5dc613c3d455a5fed9c54450fd7e46ffd92/.buildkite/pipelines/code_coverage/daily.yml#L17
|
||||||
|
*
|
||||||
|
* It is a flag that signals the job for which test runners will be executed.
|
||||||
|
*
|
||||||
|
* For example in code coverage pipeline definition, it is "limited"
|
||||||
|
* to 'unit,integration'. This means FTR tests will not be executed.
|
||||||
|
*/
|
||||||
const LIMIT_CONFIG_TYPE = process.env.LIMIT_CONFIG_TYPE
|
const LIMIT_CONFIG_TYPE = process.env.LIMIT_CONFIG_TYPE
|
||||||
? process.env.LIMIT_CONFIG_TYPE.split(',')
|
? process.env.LIMIT_CONFIG_TYPE.split(',')
|
||||||
.map((t) => t.trim())
|
.map((t) => t.trim())
|
||||||
|
@ -218,9 +227,10 @@ export async function pickTestGroupRunOrder() {
|
||||||
: ['build'];
|
: ['build'];
|
||||||
|
|
||||||
const { defaultQueue, ftrConfigsByQueue } = getEnabledFtrConfigs(FTR_CONFIG_PATTERNS);
|
const { defaultQueue, ftrConfigsByQueue } = getEnabledFtrConfigs(FTR_CONFIG_PATTERNS);
|
||||||
if (!LIMIT_CONFIG_TYPE.includes('functional')) {
|
|
||||||
ftrConfigsByQueue.clear();
|
const ftrConfigsIncluded = LIMIT_CONFIG_TYPE.includes('functional');
|
||||||
}
|
|
||||||
|
if (!ftrConfigsIncluded) ftrConfigsByQueue.clear();
|
||||||
|
|
||||||
const jestUnitConfigs = LIMIT_CONFIG_TYPE.includes('unit')
|
const jestUnitConfigs = LIMIT_CONFIG_TYPE.includes('unit')
|
||||||
? globby.sync(['**/jest.config.js', '!**/__fixtures__/**'], {
|
? globby.sync(['**/jest.config.js', '!**/__fixtures__/**'], {
|
||||||
|
@ -377,9 +387,11 @@ export async function pickTestGroupRunOrder() {
|
||||||
Fs.writeFileSync('jest_run_order.json', JSON.stringify({ unit, integration }, null, 2));
|
Fs.writeFileSync('jest_run_order.json', JSON.stringify({ unit, integration }, null, 2));
|
||||||
bk.uploadArtifacts('jest_run_order.json');
|
bk.uploadArtifacts('jest_run_order.json');
|
||||||
|
|
||||||
// write the config for functional steps to an artifact that can be used by the individual functional jobs
|
if (ftrConfigsIncluded) {
|
||||||
Fs.writeFileSync('ftr_run_order.json', JSON.stringify(ftrRunOrder, null, 2));
|
// write the config for functional steps to an artifact that can be used by the individual functional jobs
|
||||||
bk.uploadArtifacts('ftr_run_order.json');
|
Fs.writeFileSync('ftr_run_order.json', JSON.stringify(ftrRunOrder, null, 2));
|
||||||
|
bk.uploadArtifacts('ftr_run_order.json');
|
||||||
|
}
|
||||||
|
|
||||||
// upload the step definitions to Buildkite
|
// upload the step definitions to Buildkite
|
||||||
bk.uploadSteps(
|
bk.uploadSteps(
|
||||||
|
|
|
@ -13,7 +13,6 @@ steps:
|
||||||
queue: kibana-default
|
queue: kibana-default
|
||||||
env:
|
env:
|
||||||
FTR_CONFIGS_DEPS: ''
|
FTR_CONFIGS_DEPS: ''
|
||||||
# LIMIT_CONFIG_TYPE: 'unit,functional,integration'
|
|
||||||
LIMIT_CONFIG_TYPE: 'unit,integration'
|
LIMIT_CONFIG_TYPE: 'unit,integration'
|
||||||
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest.sh'
|
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest.sh'
|
||||||
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest_integration.sh'
|
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/code_coverage/jest_integration.sh'
|
||||||
|
@ -25,6 +24,5 @@ steps:
|
||||||
depends_on:
|
depends_on:
|
||||||
- jest
|
- jest
|
||||||
- jest-integration
|
- jest-integration
|
||||||
# - ftr-configs
|
|
||||||
timeout_in_minutes: 30
|
timeout_in_minutes: 30
|
||||||
key: ingest
|
key: ingest
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
buildPlatformPlugins() {
|
|
||||||
echo "--- Build Platform Plugins"
|
|
||||||
|
|
||||||
NODE_OPTIONS=--max_old_space_size=14336 \
|
|
||||||
node scripts/build_kibana_platform_plugins \
|
|
||||||
--no-examples --test-plugins --workers 4
|
|
||||||
}
|
|
||||||
|
|
||||||
runFTRInstrumented() {
|
|
||||||
local ftrConfig=$1
|
|
||||||
echo "--- $ runFTRInstrumented against $ftrConfig"
|
|
||||||
|
|
||||||
NODE_OPTIONS=--max_old_space_size=16384 \
|
|
||||||
./node_modules/.bin/nyc \
|
|
||||||
--nycrc-path ./src/dev/code_coverage/nyc_config/nyc.server.config.js \
|
|
||||||
node scripts/functional_tests \
|
|
||||||
--config="$ftrConfig" \
|
|
||||||
--exclude-tag "skipCoverage"
|
|
||||||
}
|
|
||||||
|
|
||||||
reportMergeFunctional() {
|
|
||||||
echo "--- Merging code coverage for FTR Configs"
|
|
||||||
|
|
||||||
NODE_OPTIONS=--max_old_space_size=16384 yarn nyc report \
|
|
||||||
--nycrc-path src/dev/code_coverage/nyc_config/nyc.functional.config.js --reporter json
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue