Skip to content

Commit ec5d243

Browse files
committed
adjust for easier testing
1 parent cbebdaf commit ec5d243

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

ci/zig_benchmarks/run_local_benchmarks.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ KEEP_ARTIFACTS=false
1818
ORIGINAL_BRANCH=""
1919
STASH_CREATED=false
2020
CLEANUP_DONE=false
21+
TEMP_SCRIPTS_DIR=""
2122

2223
usage() {
2324
cat <<EOF
@@ -95,6 +96,12 @@ cleanup() {
9596
git stash pop --quiet 2>/dev/null || true
9697
fi
9798

99+
# Clean up temp scripts
100+
if [ -n "$TEMP_SCRIPTS_DIR" ] && [ -d "$TEMP_SCRIPTS_DIR" ]; then
101+
echo " Removing temporary scripts"
102+
rm -rf "$TEMP_SCRIPTS_DIR"
103+
fi
104+
98105
# Clean up artifacts unless requested to keep them
99106
if [ "$KEEP_ARTIFACTS" = "false" ]; then
100107
echo " Removing benchmark artifacts"
@@ -172,6 +179,15 @@ main() {
172179
echo ""
173180
fi
174181

182+
# Copy benchmark scripts to temp location (they may not exist on base branch)
183+
log "Copying benchmark scripts to temp location"
184+
TEMP_SCRIPTS_DIR=$(mktemp -d)
185+
cp "$SCRIPT_DIR/run_fx_benchmarks.sh" "$TEMP_SCRIPTS_DIR/"
186+
cp "$SCRIPT_DIR/run_snapshot_benchmark.sh" "$TEMP_SCRIPTS_DIR/"
187+
chmod +x "$TEMP_SCRIPTS_DIR"/*.sh
188+
echo " Scripts copied to $TEMP_SCRIPTS_DIR"
189+
echo ""
190+
175191
# === BUILD BASE BRANCH ===
176192
log "Building $BASE_BRANCH branch"
177193
git checkout "$BASE_BRANCH" --quiet
@@ -207,15 +223,15 @@ main() {
207223

208224
if [ "$SKIP_FX" = "false" ]; then
209225
log "Running FX benchmarks"
210-
if ! "$SCRIPT_DIR/run_fx_benchmarks.sh" bench-main/roc bench-local/roc; then
226+
if ! "$TEMP_SCRIPTS_DIR/run_fx_benchmarks.sh" bench-main/roc bench-local/roc; then
211227
BENCHMARK_FAILED=true
212228
fi
213229
echo ""
214230
fi
215231

216232
if [ "$SKIP_SNAPSHOT" = "false" ]; then
217233
log "Running snapshot benchmarks"
218-
if ! "$SCRIPT_DIR/run_snapshot_benchmark.sh" bench-main/snapshot bench-local/snapshot; then
234+
if ! "$TEMP_SCRIPTS_DIR/run_snapshot_benchmark.sh" bench-main/snapshot bench-local/snapshot; then
219235
BENCHMARK_FAILED=true
220236
fi
221237
echo ""

0 commit comments

Comments
 (0)