Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneseymour committed May 26, 2022
1 parent 8c7c893 commit 6730c2f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
5 changes: 1 addition & 4 deletions .buildkite/scripts/steps/code_coverage/ftr_configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [[ "$configs" == "" ]]; then
configs=$(jq -r '.groups[env.JOB_NUM | tonumber].names | .[]' ftr_run_order.json)
fi

echo "--- Config(s) for this FTR Group:"
echo "--- Config(s) for this FTR Group:"
echo "${configs[@]}"

failedConfigs=""
Expand Down Expand Up @@ -91,9 +91,6 @@ while read -r config; do
echo "--- Config complete: $config"
done <<<"$configs"

#dirListing "target/dir-listing-functional-post-loop.txt" target/kibana-coverage/functional
#fileHeads "target/file-heads-functional-post-loop.txt" target/kibana-coverage/functional

# Each browser unload event, creates a new coverage file.
# So, we merge them here.
if [[ -d "$functionalTarget" ]]; then
Expand Down
11 changes: 6 additions & 5 deletions .buildkite/scripts/steps/code_coverage/ingest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ echo "--- collect VCS Info"
.buildkite/scripts/steps/code_coverage/reporting/collectVcsInfo.sh

echo "--- Jest: Reset file paths prefix, merge coverage files, and generate the final combined report"
echo "### Jest: Reset file paths prefix to Kibana Dir of final worker"
#sed -ie "s|CC_REPLACEMENT_ANCHOR|${KIBANA_DIR}|g" target/kibana-coverage/jest/*.json
# Jest: Reset file paths prefix to Kibana Dir of final worker
replacePaths "$KIBANA_DIR/target/kibana-coverage/jest" "CC_REPLACEMENT_ANCHOR" "$KIBANA_DIR"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js

echo "--- Functional: Reset file paths prefix, merge coverage files, and generate the final combined report"
echo "### Functional: Reset file paths prefix to Kibana Dir of final worker"
# Functional: Reset file paths prefix to Kibana Dir of final worker
set +e
sed -ie "s|CC_REPLACEMENT_ANCHOR|${KIBANA_DIR}|g" target/kibana-coverage/functional/*.json
echo "--- Begin Split and Merge for Functional"
Expand All @@ -53,8 +52,10 @@ splitMerge
set -e

echo "--- Archive and upload combined reports"
collectAndUpload target/kibana-coverage/jest/kibana-jest-coverage.tar.gz target/kibana-coverage/jest-combined
collectAndUpload target/kibana-coverage/functional/kibana-functional-coverage.tar.gz target/kibana-coverage/functional-combined
collectAndUpload target/kibana-coverage/jest/kibana-jest-coverage.tar.gz \
target/kibana-coverage/jest-combined
collectAndUpload target/kibana-coverage/functional/kibana-functional-coverage.tar.gz \
target/kibana-coverage/functional-combined

echo "--- Upload coverage static site"
.buildkite/scripts/steps/code_coverage/reporting/uploadStaticSite.sh
Expand Down
3 changes: 1 addition & 2 deletions .buildkite/scripts/steps/code_coverage/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ echo "--- downloading jest test run order"
buildkite-agent artifact download jest_run_order.json .
configs=$(jq -r 'getpath([env.TEST_TYPE]) | .groups[env.JOB | tonumber].names | .[]' jest_run_order.json)

echo "--- Print KIBANA_DIR"
echo "### KIBANA_DIR: $KIBANA_DIR"
echo "--- KIBANA_DIR: $KIBANA_DIR"

echo "--- Config(s) for this JEST Group:"
echo "${configs[@]}"
Expand Down
18 changes: 2 additions & 16 deletions .buildkite/scripts/steps/code_coverage/merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,11 @@ first="$target/first"
rest="$target/rest"

filesCount() {
if [[ "$OSTYPE" == "darwin"* ]]; then
count=$(find "$1" -maxdepth 1 -type f | grep -vc ".DS*" | xargs) # xargs trims whitespace
else
count=$(find "$1" -maxdepth 1 -type f | wc -l | xargs) # xargs trims whitespace
fi
count=$(find "$1" -maxdepth 1 -type f | wc -l | xargs) # xargs trims whitespace
}

_head() {
if [[ "$OSTYPE" == "darwin"* ]]; then
count=$(find "$1" -maxdepth 1 -type f | grep -vc ".DS*" | xargs) # xargs trims whitespace
firstFile=$(find "$1" -maxdepth 1 -type f | grep -v ".DS*" | head -1)
else
count=$(find "$1" -maxdepth 1 -type f | wc -l | xargs) # xargs trims whitespace
firstFile=$(find "$1" -maxdepth 1 -type f | head -1)
fi
firstFile=$(find "$1" -maxdepth 1 -type f | head -1)
}

splitCoverage() {
Expand Down Expand Up @@ -61,10 +51,6 @@ splitMerge() {
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.functional.config.js
}

listReports() {
ls -R $base
}

uniqueifyFunctional() {
local unique=${1:?"Must pass first positional arg for 'unique'"}

Expand Down

0 comments on commit 6730c2f

Please sign in to comment.