[dev] CI: drop baseline caching in perfromance metrics job (#51804)

This commit is contained in:
Vladimir Reznichenko 2024-10-01 09:05:53 +02:00 committed by GitHub
parent e48b0352fe
commit ce5f7cb471
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 35 deletions

View File

@ -183,14 +183,6 @@ jobs:
with:
pattern: 'last-run__${{ strategy.job-index }}'
- name: 'Download Performance metrics baseline'
if: ${{ matrix.report.resultsPath != '' && matrix.testType == 'performance'}}
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319
with:
path: 'tools/compare-perf/artifacts/*_55f855a2e6d769b5ae44305b2772eb30d3e721df_*'
key: "${{ runner.os }}-woocommerce-performance-metrics-55f855a2e6d769b5ae44305b2772eb30d3e721df-${{ hashFiles( 'plugins/woocommerce/tests/performance/**/*.js' ) }}"
restore-keys: '${{ runner.os }}-woocommerce-performance-metrics-55f855a2e6d769b5ae44305b2772eb30d3e721df-'
- name: 'Run tests (${{ matrix.testType }})'
env:
E2E_ENV_KEY: ${{ secrets.E2E_ENV_KEY }}

View File

@ -2,7 +2,7 @@
set -eo pipefail
# The commented variables are for troubleshooting locally.
# The commented variables are for troubleshooting locally. The commented commands below are also for local troubleshooting.
# GITHUB_EVENT_NAME='pull_request'
# GITHUB_SHA=$(git rev-parse HEAD)
# ARTIFACTS_PATH="$(realpath $(dirname -- ${BASH_SOURCE[0]})/../../../tools/compare-perf)/artifacts"
@ -34,20 +34,16 @@ if [ "$GITHUB_EVENT_NAME" == "push" ] || [ "$GITHUB_EVENT_NAME" == "pull_request
if test -n "$(find $ARTIFACTS_PATH -maxdepth 1 -name "*_${GITHUB_SHA}_*" -print -quit)"; then
title "Skipping benchmarking head as benchmarking results already available under $ARTIFACTS_PATH"
else
title "##[group]Building head"
git -c core.hooksPath=/dev/null checkout --quiet $HEAD_BRANCH > /dev/null && echo 'On' $(git rev-parse HEAD)
pnpm run --if-present clean:build
pnpm install --filter='@woocommerce/plugin-woocommerce...' --frozen-lockfile --config.dedupe-peer-dependents=false
pnpm --filter='@woocommerce/plugin-woocommerce' build
echo '##[endgroup]'
# title "##[group]Building head"
# git -c core.hooksPath=/dev/null checkout --quiet $HEAD_BRANCH > /dev/null && echo 'On' $(git rev-parse HEAD)
# pnpm run --if-present clean:build
# pnpm install --filter='@woocommerce/plugin-woocommerce...' --frozen-lockfile --config.dedupe-peer-dependents=false
# pnpm --filter='@woocommerce/plugin-woocommerce' build
# echo '##[endgroup]'
title "##[group]Benchmarking head"
for ROUND in {1..2}; do
# We can afford only 2 rounds, each one takes ~2 minutes.
echo "$(date +"%T"): Round $ROUND of 2"
RESULTS_ID="editor_${GITHUB_SHA}_round-$ROUND" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics editor
RESULTS_ID="product-editor_${GITHUB_SHA}_round-$ROUND" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics product-editor
done
RESULTS_ID="editor_${GITHUB_SHA}_round-1" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics editor
RESULTS_ID="product-editor_${GITHUB_SHA}_round-1" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics product-editor
echo '##[endgroup]'
fi
@ -60,26 +56,21 @@ if [ "$GITHUB_EVENT_NAME" == "push" ] || [ "$GITHUB_EVENT_NAME" == "pull_request
title "##[group]Building baseline"
git -c core.hooksPath=/dev/null checkout --quiet $BASE_SHA > /dev/null && echo 'On' $(git rev-parse HEAD)
pnpm run --if-present clean:build
pnpm run --if-present clean:build &
pnpm install --filter='@woocommerce/plugin-woocommerce...' --frozen-lockfile --config.dedupe-peer-dependents=false
pnpm --filter='@woocommerce/plugin-woocommerce' build
echo '##[endgroup]'
title "##[group]Benchmarking baseline"
for ROUND in {1..3}; do
# Each round takes ~2 minutes, running for ~6 minutes presumable generates good enough baseline (cached for 1 week in CI).
echo "$(date +"%T"): Round $ROUND of 3"
RESULTS_ID="editor_${BASE_SHA}_round-$ROUND" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics editor
RESULTS_ID="product-editor_${BASE_SHA}_round-$ROUND" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics product-editor
done
RESULTS_ID="editor_${BASE_SHA}_round-1" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics editor
RESULTS_ID="product-editor_${BASE_SHA}_round-1" pnpm --filter="@woocommerce/plugin-woocommerce" test:metrics product-editor
echo '##[endgroup]'
# This step is intended for running the script locally.
title "##[group]Restoring codebase state back to head"
git -c core.hooksPath=/dev/null checkout --quiet $HEAD_BRANCH > /dev/null && echo 'On' $(git rev-parse HEAD)
pnpm install --frozen-lockfile > /dev/null &
pnpm run --if-present clean:build
echo '##[endgroup]'
# title "##[group]Restoring codebase state back to head"
# git -c core.hooksPath=/dev/null checkout --quiet $HEAD_BRANCH > /dev/null && echo 'On' $(git rev-parse HEAD)
# pnpm install --frozen-lockfile > /dev/null &
# pnpm run --if-present clean:build
# echo '##[endgroup]'
fi
title "##[group]Processing reports under $ARTIFACTS_PATH"

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
CI: omit caching baseline results in perfromance metrics job.

View File

@ -483,7 +483,6 @@
"start": "test:perf:ci-setup"
},
"events": [
"pull_request",
"push"
]
},