From 6ce88cfb3564b2f3c9a19b41a7059a6b255f98a1 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Tue, 2 Apr 2024 16:12:09 +0000 Subject: [PATCH] repeat-perf-test: allow specifying adapters --- bin/repeat-perf-test.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/repeat-perf-test.sh b/bin/repeat-perf-test.sh index 6f887b85e9..5b6ecd2c2e 100755 --- a/bin/repeat-perf-test.sh +++ b/bin/repeat-perf-test.sh @@ -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=] $0 ...tree-ish + [PERF_REPEATS=] $0 ...tree-ish:adapter EOF exit 1 @@ -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. !!!" @@ -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