Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[coverage] speed up merging results of functional tests #92111

Merged
merged 15 commits into from
Feb 22, 2021
14 changes: 0 additions & 14 deletions src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ TEAM_ASSIGN_PATH=$5
# Build team assignments dat file
node scripts/generate_team_assignments.js --verbose --src .github/CODEOWNERS --dest $TEAM_ASSIGN_PATH

# Need to override COVERAGE_INGESTION_KIBANA_ROOT since json file has original intake worker path
export COVERAGE_INGESTION_KIBANA_ROOT=/dev/shm/workspace/kibana

for x in functional jest; do
echo "### Ingesting coverage for ${x}"

COVERAGE_SUMMARY_FILE=target/kibana-coverage/${x}-combined/coverage-summary.json

if [[ $x == "jest" ]]; then
# Need to override COVERAGE_INGESTION_KIBANA_ROOT since json file has original intake worker path
export COVERAGE_INGESTION_KIBANA_ROOT=/dev/shm/workspace/kibana
fi
# running in background to speed up ingestion
node scripts/ingest_coverage.js --verbose --path ${COVERAGE_SUMMARY_FILE} --vcsInfoPath ./VCS_INFO.txt --teamAssignmentsPath $TEAM_ASSIGN_PATH &
done
Expand Down
20 changes: 20 additions & 0 deletions src/dev/code_coverage/shell_scripts/merge_functional.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,25 @@
COVERAGE_TEMP_DIR=/tmp/extracted_coverage/target/kibana-coverage/
export COVERAGE_TEMP_DIR

checkoutDir="$(pwd)"
echo "### checkoutDir=${checkoutDir}"

coverageBasePath="/dev/shm/workspace"
echo "### Clone kibana to ${coverageBasePath}"
mkdir -p "$coverageBasePath/kibana"
rsync -ahSD --ignore-errors --force --delete --stats ./ "$coverageBasePath/kibana/"
cd "$coverageBasePath/kibana"

echo "### bootstrap from x-pack folder"
cd x-pack
yarn kbn bootstrap
# Return to project root
cd ..
echo "### Merge coverage reports"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.functional.config.js

echo "### Copy 'target' to ${checkoutDir}"
rsync -ahSD --ignore-errors --force --delete --stats target "$checkoutDir/"

echo "### Back to $checkoutDir"
cd "$checkoutDir"
6 changes: 0 additions & 6 deletions vars/kibanaCoverage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,7 @@ def collectVcsInfo(title) {
def generateReports(title) {
kibanaPipeline.bash("""
source src/dev/ci_setup/setup_env.sh true
# bootstrap from x-pack folder
cd x-pack
yarn kbn bootstrap
# Return to project root
cd ..
. src/dev/code_coverage/shell_scripts/extract_archives.sh
. src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh
. src/dev/code_coverage/shell_scripts/merge_functional.sh
. src/dev/code_coverage/shell_scripts/copy_jest_report.sh
# zip functional combined report
Expand Down