Compare commits
6 commits
main
...
migrate-co
Author | SHA1 | Date | |
---|---|---|---|
8613ffaf33 | |||
a0b5eb4580 | |||
f5f24061cd | |||
5e67ab3201 | |||
01e736904d | |||
6807a40ada |
60
.buildkite/pipelines/code_coverage/daily.yml
Normal file
60
.buildkite/pipelines/code_coverage/daily.yml
Normal file
|
@ -0,0 +1,60 @@
|
|||
env:
|
||||
CODE_COVERAGE: '1'
|
||||
NODE_ENV: 'test'
|
||||
steps:
|
||||
- command: .buildkite/scripts/lifecycle/pre_build.sh
|
||||
label: Pre-Build
|
||||
timeout_in_minutes: 10
|
||||
|
||||
- wait
|
||||
|
||||
- command: .buildkite/scripts/steps/build_kibana.sh
|
||||
label: Build Kibana Distribution and Plugins
|
||||
agents:
|
||||
queue: c2-16
|
||||
key: build
|
||||
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
|
||||
timeout_in_minutes: 60
|
||||
|
||||
- command: .buildkite/scripts/steps/code_coverage/xpack_cigroup.sh
|
||||
label: 'Default CI Group'
|
||||
parallelism: 13
|
||||
agents:
|
||||
queue: ci-group-6
|
||||
depends_on: build
|
||||
timeout_in_minutes: 250
|
||||
key: default-cigroup
|
||||
retry:
|
||||
automatic:
|
||||
- exit_status: '*'
|
||||
limit: 1
|
||||
|
||||
- command: .buildkite/scripts/steps/code_coverage/oss_cigroup.sh
|
||||
label: 'OSS CI Group'
|
||||
parallelism: 11
|
||||
agents:
|
||||
queue: ci-group-4d
|
||||
depends_on: build
|
||||
timeout_in_minutes: 120
|
||||
key: oss-cigroup
|
||||
retry:
|
||||
automatic:
|
||||
- exit_status: '*'
|
||||
limit: 1
|
||||
|
||||
- command: .buildkite/scripts/steps/code_coverage/jest.sh
|
||||
label: 'Jest Tests'
|
||||
agents:
|
||||
queue: c2-16
|
||||
timeout_in_minutes: 150
|
||||
key: jest
|
||||
|
||||
- wait: ~
|
||||
continue_on_failure: true
|
||||
|
||||
- command: .buildkite/scripts/steps/code_coverage/ingest.sh
|
||||
label: Post-Build
|
||||
agents:
|
||||
queue: c2-16
|
||||
timeout_in_minutes: 120
|
||||
key: jest
|
|
@ -10,7 +10,6 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
|
|||
echo "--- Upload Artifacts"
|
||||
buildkite-agent artifact upload 'target/junit/**/*'
|
||||
buildkite-agent artifact upload 'target/kibana-*'
|
||||
buildkite-agent artifact upload 'target/kibana-coverage/jest/**/*'
|
||||
buildkite-agent artifact upload 'target/kibana-security-solution/**/*.png'
|
||||
buildkite-agent artifact upload 'target/test-metrics/*'
|
||||
buildkite-agent artifact upload 'target/test-suites-ci-plan.json'
|
||||
|
@ -25,6 +24,13 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
|
|||
buildkite-agent artifact upload 'x-pack/test/functional/failure_debug/html/*.html'
|
||||
buildkite-agent artifact upload '.es/**/*.hprof'
|
||||
|
||||
if [[ "$CODE_COVERAGE" == "1" ]]; then
|
||||
sh 'tar -czf kibana-coverage.tar.gz target/kibana-coverage/**/*'
|
||||
buildkite-agent artifact upload 'kibana-coverage.tar.gz'
|
||||
else
|
||||
buildkite-agent artifact upload 'target/kibana-coverage/jest/**/*'
|
||||
fi
|
||||
|
||||
echo "--- Run Failed Test Reporter"
|
||||
node scripts/report_failed_tests --build-url="${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}" 'target/junit/**/*.xml'
|
||||
|
||||
|
|
29
.buildkite/scripts/steps/code_coverage/ingest.sh
Executable file
29
.buildkite/scripts/steps/code_coverage/ingest.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source .buildkite/scripts/common/util.sh
|
||||
|
||||
is_test_execution_step
|
||||
|
||||
.buildkite/scripts/bootstrap.sh
|
||||
|
||||
# download coverage arctifacts
|
||||
buildkite-agent artifact download kibana-default.tar.gz . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}"
|
||||
# process HTML Links
|
||||
.buildkite/scripts/steps/code_coverage/ingest/prokLinks.sh
|
||||
# collect VCS Info
|
||||
.buildkite/scripts/steps/code_coverage/ingest/collectVcsInfo.sh
|
||||
# merge coverage reports
|
||||
. src/dev/code_coverage/shell_scripts/extract_archives.sh
|
||||
. src/dev/code_coverage/shell_scripts/merge_functional.sh
|
||||
. src/dev/code_coverage/shell_scripts/copy_jest_report.sh
|
||||
# zip functional combined report
|
||||
tar -czf kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined/*
|
||||
|
||||
ls -laR target/kibana-coverage/
|
||||
buildkite-agent artifact upload 'kibana-functional-coverage.tar.gz'
|
||||
# upload coverage static site
|
||||
#.buildkite/scripts/steps/code_coverage/ingest/uploadStaticSite.sh
|
||||
#ingest results to Kibana stats cluster
|
||||
#. src/dev/code_coverage/shell_scripts/generate_team_assignments_and_ingest_coverage.sh '${jobName}' ${buildNum} '${buildUrl}' '${previousSha}' '${teamAssignmentsPath}'
|
30
.buildkite/scripts/steps/code_coverage/ingest/collectVcsInfo.sh
Executable file
30
.buildkite/scripts/steps/code_coverage/ingest/collectVcsInfo.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "### Prok'd Index File: ..."
|
||||
cat src/dev/code_coverage/www/index.html
|
||||
|
||||
predicate() {
|
||||
x=$1
|
||||
if [ -n "$x" ]; then
|
||||
return
|
||||
else
|
||||
echo "### 1 or more variables that Code Coverage needs, are undefined"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
CMD="git log --pretty=format"
|
||||
XS=("${GIT_BRANCH}" \
|
||||
"$(${CMD}":%h" -1)" \
|
||||
"$(${CMD}":%an" -1)" \
|
||||
"$(${CMD}":%s" -1)")
|
||||
touch VCS_INFO.txt
|
||||
for X in "${!XS[@]}"; do
|
||||
{
|
||||
predicate "${XS[X]}"
|
||||
echo "${XS[X]}" >> VCS_INFO.txt
|
||||
}
|
||||
done
|
||||
echo "### VCS_INFO:"
|
||||
cat VCS_INFO.txt
|
31
.buildkite/scripts/steps/code_coverage/ingest/prokLinks.sh
Executable file
31
.buildkite/scripts/steps/code_coverage/ingest/prokLinks.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cat << EOF > src/dev/code_coverage/www/index_partial_2.html
|
||||
<a class="nav-link" href="https://kibana-coverage.elastic.dev/${TIME_STAMP}/jest-combined/index.html">Latest Jest</a>
|
||||
<a class="nav-link" href="https://kibana-coverage.elastic.dev/${TIME_STAMP}/functional-combined/index.html">Latest FTR</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main role="main" class="inner cover">
|
||||
<!-- <h1 class="cover-heading"> - Master Branch</h1>-->
|
||||
<p class="lead">Use Kibana Stats to mine coverage data</p>
|
||||
<p class="lead">
|
||||
<a href="https://kibana-stats.elastic.dev/app/kibana#/dashboard/58b8db70-62f9-11ea-8312-7f2d69b79843?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-7d%2Cto%3Anow))" class="btn btn-lg btn-primary">Dashboard</a>
|
||||
</p>
|
||||
</main>
|
||||
|
||||
<footer class="mastfoot mt-auto">
|
||||
<div class="inner">
|
||||
<p>Please slack us at <a href="https://app.slack.com/client/T0CUZ52US/C0TR0FAET">#kibana-qa</a> if youve questions</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
cat src/dev/code_coverage/www/index_partial.html > src/dev/code_coverage/www/index.html
|
||||
cat src/dev/code_coverage/www/index_partial_2.html >> src/dev/code_coverage/www/index.html
|
16
.buildkite/scripts/steps/code_coverage/ingest/uploadStaticSite.sh
Executable file
16
.buildkite/scripts/steps/code_coverage/ingest/uploadStaticSite.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# def uploadPrefix = "gs://elastic-bekitzur-kibana-coverage-live/"
|
||||
# def uploadPrefixWithTimeStamp = "${uploadPrefix}${timestamp}/"
|
||||
|
||||
# [
|
||||
# 'src/dev/code_coverage/www/index.html',
|
||||
# 'src/dev/code_coverage/www/404.html'
|
||||
# ].each { uploadWithVault(uploadPrefix, it) }
|
||||
|
||||
# [
|
||||
# 'target/kibana-coverage/functional-combined',
|
||||
# 'target/kibana-coverage/jest-combined',
|
||||
# ].each { uploadWithVault(uploadPrefixWithTimeStamp, it) }
|
18
.buildkite/scripts/steps/code_coverage/jest.sh
Executable file
18
.buildkite/scripts/steps/code_coverage/jest.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source .buildkite/scripts/common/util.sh
|
||||
|
||||
is_test_execution_step
|
||||
|
||||
.buildkite/scripts/bootstrap.sh
|
||||
|
||||
echo '--- Jest with coverage'
|
||||
node --max-old-space-size=6144 scripts/jest --ci --maxWorkers=10 --coverage || true
|
||||
|
||||
echo '--- Jest Integration Tests with coverage'
|
||||
node --max-old-space-size=5120 scripts/jest_integration --ci --coverage || true
|
||||
|
||||
echo "--- Combine code coverage in a single report"
|
||||
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js
|
30
.buildkite/scripts/steps/code_coverage/oss_cigroup.sh
Executable file
30
.buildkite/scripts/steps/code_coverage/oss_cigroup.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source .buildkite/scripts/steps/functional/common.sh
|
||||
|
||||
export CI_GROUP=${CI_GROUP:-$((BUILDKITE_PARALLEL_JOB+1))}
|
||||
export JOB=kibana-oss-ciGroup${CI_GROUP}
|
||||
|
||||
echo "--- OSS CI Group $CI_GROUP"
|
||||
echo " -> Running Functional tests with code coverage"
|
||||
export NODE_OPTIONS=--max_old_space_size=8192
|
||||
|
||||
echo " -> making hard link clones"
|
||||
cd ..
|
||||
cp -RlP kibana "kibana${CI_GROUP}"
|
||||
cd "kibana${CI_GROUP}"
|
||||
|
||||
echo " -> running tests from the clone folder"
|
||||
node scripts/functional_tests \
|
||||
--include-tag "ciGroup$CI_GROUP" \
|
||||
--exclude-tag "skipCoverage" || true
|
||||
|
||||
echo " -> moving junit output, silently fail in case of no report"
|
||||
mkdir -p ../kibana/target/junit
|
||||
mv target/junit/* ../kibana/target/junit/ || echo "copying junit failed"
|
||||
|
||||
echo " -> copying screenshots and html for failures"
|
||||
cp -r test/functional/screenshots/* ../kibana/test/functional/screenshots/ || echo "copying screenshots failed"
|
||||
cp -r test/functional/failure_debug ../kibana/test/functional/ || echo "copying html failed"
|
33
.buildkite/scripts/steps/code_coverage/xpack_cigroup.sh
Executable file
33
.buildkite/scripts/steps/code_coverage/xpack_cigroup.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source .buildkite/scripts/steps/functional/common.sh
|
||||
|
||||
export CI_GROUP=${CI_GROUP:-$((BUILDKITE_PARALLEL_JOB+1))}
|
||||
export JOB=kibana-default-ciGroup${CI_GROUP}
|
||||
|
||||
echo "--- Default CI Group $CI_GROUP"
|
||||
|
||||
echo " -> Running X-Pack functional tests with code coverage"
|
||||
export NODE_OPTIONS=--max_old_space_size=8192
|
||||
|
||||
echo " -> making hard link clones"
|
||||
cd ..
|
||||
cp -RlP kibana "kibana${CI_GROUP}"
|
||||
cd "kibana${CI_GROUP}/x-pack"
|
||||
|
||||
echo " -> running tests from the clone folder"
|
||||
node scripts/functional_tests \
|
||||
--include-tag "ciGroup$CI_GROUP" \
|
||||
--exclude-tag "skipCoverage" || true
|
||||
|
||||
echo " -> moving junit output, silently fail in case of no report"
|
||||
mkdir -p ../../kibana/target/junit
|
||||
mv ../target/junit/* ../../kibana/target/junit/ || echo "copying junit failed"
|
||||
|
||||
echo " -> copying screenshots and html for failures"
|
||||
cp -r test/functional/screenshots/* ../../kibana/x-pack/test/functional/screenshots/ || echo "copying screenshots failed"
|
||||
cp -r test/functional/failure_debug ../../kibana/x-pack/test/functional/ || echo "copying html failed"
|
||||
|
||||
cd "$KIBANA_DIR"
|
Loading…
Reference in a new issue