Skip to content

Commit

Permalink
repeat-perf-test: allow specifying adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed Apr 2, 2024
1 parent acc12f6 commit 6ce88cf
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions bin/repeat-perf-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [[ "$#" -lt 1 ]]; then
Repeatedly run the performance test suite against one or more versions of the codebase.
USAGE
[PERF_REPEATS=<N>] $0 ...tree-ish
[PERF_REPEATS=<N>] $0 ...tree-ish:adapter
EOF
exit 1
Expand All @@ -52,10 +52,13 @@ fi
log
declare -a commits
i=0
for treeish in "$@"; do
for treeish_adapter in "$@"; do
adapter="${treeish_adapter#*:}"
treeish="${treeish_adapter%:*}"
adapters[i]="$adapter"
commits[i]="$(git rev-parse "$treeish")"
description="$(git show --oneline --no-patch "$treeish")"
log " $((i=i+1)). $description ($treeish)"
log " $((i=i+1)). $adapter: $description ($treeish)"
done
log
log "!!! This may cause strange issues if you have uncomitted changes. !!!"
Expand Down Expand Up @@ -91,13 +94,16 @@ npm_install # in case of different deps on different branches
npm run build-test

iterate_tests() {
for commit in "${commits[@]}"; do
log "Running perf tests on $commit..."
for i in "${!commits[@]}"; do
commit="${commits[$i]}"
adapter="${adapters[$i]}"
log "Running perf tests on $commit with adapter-$adapter..."
SRC_ROOT="../../dist-bundles/$commit" \
JSON_REPORTER=1 \
PERF=1 \
USE_MINIFIED=1 \
MANUAL_DEV_SERVER=1 \
ADAPTERS="$adapter" \
node ./bin/test-browser.js

sleep 1
Expand Down

0 comments on commit 6ce88cf

Please sign in to comment.