Fix code coverage for jest, upload merged reports (#68149)

* replace path in json files

* upload combined reports to artifacts for debug purpose
This commit is contained in:
Dmitry Lemeshko 2020-06-03 22:21:28 +02:00 committed by GitHub
parent b3e7ab3f5c
commit 77abbf257d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 3 deletions

View file

@ -23,6 +23,8 @@ def handleIngestion(timestamp) {
kibanaPipeline.downloadCoverageArtifacts()
kibanaCoverage.prokLinks("### Process HTML Links")
kibanaCoverage.collectVcsInfo("### Collect VCS Info")
kibanaCoverage.generateReports("### Merge coverage reports")
kibanaCoverage.uploadCombinedReports()
kibanaCoverage.ingest(timestamp, '### Injest && Upload')
kibanaCoverage.uploadCoverageStaticSite(timestamp)
}

View file

@ -7,7 +7,13 @@ COMBINED_EXRACT_DIR=/${EXTRACT_START_DIR}/${EXTRACT_END_DIR}
PWD=$(pwd)
du -sh $COMBINED_EXRACT_DIR
echo "### Replacing path in json files"
echo "### Jest: replacing path in json files"
for i in coverage-final xpack-coverage-final; do
sed -i "s|/dev/shm/workspace/kibana|${PWD}|g" $COMBINED_EXRACT_DIR/jest/${i}.json &
done
wait
echo "### Functional: replacing path in json files"
for i in {1..9}; do
sed -i "s|/dev/shm/workspace/kibana|${PWD}|g" $COMBINED_EXRACT_DIR/functional/${i}*.json &
done

View file

@ -96,7 +96,7 @@ def collectVcsInfo(title) {
)
}
def bootMergeAndIngest(buildNum, buildUrl, title) {
def generateReports(title) {
kibanaPipeline.bash("""
source src/dev/ci_setup/setup_env.sh
# bootstrap from x-pack folder
@ -108,6 +108,28 @@ def bootMergeAndIngest(buildNum, buildUrl, title) {
. src/dev/code_coverage/shell_scripts/fix_html_reports_parallel.sh
. src/dev/code_coverage/shell_scripts/merge_jest_and_functional.sh
. src/dev/code_coverage/shell_scripts/copy_mocha_reports.sh
# zip combined reports
tar -czf kibana-coverage.tar.gz target/kibana-coverage/**/*
""", title)
}
def uploadCombinedReports() {
kibanaPipeline.bash("""
ls -laR target/kibana-coverage/
""", "### List Combined Reports"
)
kibanaPipeline.uploadGcsArtifact(
"kibana-ci-artifacts/jobs/${env.JOB_NAME}/${BUILD_NUMBER}/coverage/combined",
'kibana-coverage.tar.gz'
)
}
def ingestData(buildNum, buildUrl, title) {
kibanaPipeline.bash("""
source src/dev/ci_setup/setup_env.sh
yarn kbn bootstrap --prefer-offline
# Using existing target/kibana-coverage folder
. src/dev/code_coverage/shell_scripts/ingest_coverage.sh ${buildNum} ${buildUrl}
""", title)
}
@ -117,7 +139,7 @@ def ingestWithVault(buildNum, buildUrl, title) {
withVaultSecret(secret: vaultSecret, secret_field: 'host', variable_name: 'HOST_FROM_VAULT') {
withVaultSecret(secret: vaultSecret, secret_field: 'username', variable_name: 'USER_FROM_VAULT') {
withVaultSecret(secret: vaultSecret, secret_field: 'password', variable_name: 'PASS_FROM_VAULT') {
bootMergeAndIngest(buildNum, buildUrl, title)
ingestData(buildNum, buildUrl, title)
}
}
}