#!/usr/bin/env bash # Standalone reproduction commands. No QA Kraken source checkout is required. # Run expensive work through your normal resource manager (memcap on the test Mac). set -eu if [ "$#" -lt 3 ] || [ "$#" -gt 4 ]; then echo 'Usage: bash run.sh PROFILE APP_REPO NEW_OUTPUT_DIR [QA_BINARY]' >&2 echo 'Profiles: grafana-demo grafana-full grafana-states umami realworld shadcn-static' >&2 exit 2 fi profile=$1 repo=$(cd "$2" && pwd) out=$3 qa_bin=${4:-qa} here=$(cd "$(dirname "$0")" && pwd) case "$profile" in grafana-*) revision=6193dc03311b631b9727b560d24369e683dc396e ;; umami) revision=ec0ff50388c264ed8ce46f00967e92f7e71476ae ;; realworld) revision=eabb81ae3bd7ffc04b2df23cf1c74e4d5385280b ;; shadcn-static) revision=e16c87f213a5ba5e45964e9b67c792105ec74d26 ;; *) echo 'Unknown profile' >&2; exit 2 ;; esac [ "$(git -C "$repo" rev-parse HEAD)" = "$revision" ] || { echo 'Source revision differs from this benchmark. See README.txt.' >&2; exit 2; } git -C "$repo" diff --quiet HEAD -- || { echo 'Tracked source changes must be resolved before a comparable run.' >&2; exit 2; } [ ! -e "$out" ] || { echo 'Output directory exists. Use a new directory; previous results are never overwritten.' >&2; exit 2; } umask 077 mkdir -p "$out" out=$(cd "$out" && pwd) "$qa_bin" dev version --json > "$out/cli-version.txt" 2> "$out/version-stderr.log" node "$here/summarize.mjs" begin "$out" "$profile" "$revision" args=(verify "$repo") case "$profile" in grafana-demo) args+=(--base http://127.0.0.1:18765 --routes "/dashboards,/alerting/list,/explore" --widths "390,1440" --prod --no-warm --no-journeys --parallel 1 --settle 1200) ;; grafana-full) args+=(--base http://127.0.0.1:18765 --routes "/,/dashboards,/dashboards/f/qa-demo,/profile,/profile/password,/org,/alerting/list,/d/qa-demo-1/service-overview,/d/qa-demo-2/api-performance,/d/qa-demo-3/infrastructure-health,/d/qa-demo-4/business-activity,/d/qa-demo-5/error-analysis,/d/qa-demo-6/capacity-planning,/connections/datasources,/connections/datasources/edit/qa-testdata,/org/teams,/org/serviceaccounts,/admin/users,/dashboard/new,/dashboard/import,/library-panels,/explore" --widths "390,768,1440" --prod --no-warm --capture --no-journeys --parallel 1 --settle 1200) ;; grafana-states) args+=(--base http://127.0.0.1:18765 --routes "/dashboards,/org/teams,/org/serviceaccounts" --width 1440 --states "empty,error,forbidden,malformed,slow" --prod --no-warm --no-journeys) ;; umami) args+=(--base https://cloud.umami.is --routes "/analytics/eu/share/LGazGOecbDtaIwDr,/analytics/eu/share/LGazGOecbDtaIwDr/events,/analytics/eu/share/LGazGOecbDtaIwDr/goals" --widths "390,1440" --prod --no-warm --no-journeys --parallel 1 --settle 1800 --nav-timeout 10000 --warm-timeout 10000) ;; realworld) args+=(--base https://react-query-realworld.netlify.app --routes "/,/login,/register" --widths "390,1440" --prod --no-warm --no-journeys --capture --parallel 1 --settle 1800 --nav-timeout 10000 --warm-timeout 10000) ;; shadcn-static) ;; *) echo 'Unknown Grafana profile' >&2; exit 2 ;; esac set +e "$qa_bin" "${args[@]}" --json > "$out/stdout.log" 2> "$out/stderr.log" code=$? set -e node "$here/summarize.mjs" finish "$out" "$repo" "$code" echo "QA exit: $code. Private logs and public-summary.json saved to the selected output directory." exit "$code"