#!/usr/bin/env bash
set -u
wt=/home/ubuntu/wt/pr-23671; out=/tmp/ev-23671/evidence/helper-rows-after.txt
src=/tmp/ev-23671/evidence/driver/WorkspaceReservation.driver.test.ts
dst=$wt/apps/server/src/workspace/WorkspaceReservation.driver.test.ts
{
  echo "LABEL: unit driver against withCheckpointRestoreReservation / withTurnStartReservation (apps/server/src/workspace/workspaceLease.ts) on real temp dirs; head only"
  echo "git rev-parse HEAD: $(git -C "$wt" rev-parse HEAD)"
  echo "driver: $src sha256=$(sha256sum "$src" | cut -d' ' -f1)"
  echo "command: (cd $wt/apps/server && vp test run src/workspace/WorkspaceReservation.driver.test.ts --silent=false --reporter=verbose)"
  echo "date: $(date -u +%FT%TZ)"
  echo "----"
} > "$out"
cp "$src" "$dst"
(cd "$wt/apps/server" && vp test run src/workspace/WorkspaceReservation.driver.test.ts --silent=false --reporter=verbose) >> "$out" 2>&1
echo "exit: $?" >> "$out"
rm "$dst"
echo "---- git status --porcelain after cleanup:" >> "$out"
git -C "$wt" status --porcelain >> "$out"
echo "(end)" >> "$out"
