diff --git a/ui/CLAUDE.md b/ui/CLAUDE.md index 9c18dc0..66c0701 100644 --- a/ui/CLAUDE.md +++ b/ui/CLAUDE.md @@ -3,11 +3,12 @@ ## Running UI tests ```bash -bash ui/main_status.sh # Status filtering, path filtering, recursive -bash ui/main_progress.sh # Progress bars: 100x1MB + 1x500MB -bash ui/main_parallel.sh # Thread control benchmarks -bash ui/main_log.sh # Logging: off/info/debug/warn/error, threads, transitions -bash ui/cleanup.sh # Remove temp dirs left by tests +bash ui/main_status.sh # Status filtering, path filtering, recursive +bash ui/main_recursive.sh # Recursive flag across add/get/status +bash ui/main_progress.sh # Progress bars: 100x1MB + 1x500MB +bash ui/main_parallel.sh # Thread control benchmarks +bash ui/main_log.sh # Logging: off/info/debug/warn/error, threads, transitions +bash ui/cleanup.sh # Remove temp dirs left by tests ``` All scripts use `set -euox pipefail` and trap on ERR, so a nonzero exit code means something failed. But **exit code 0 is not sufficient** — always redirect output to a log file, then read the log and verify: diff --git a/ui/main_recursive.sh b/ui/main_recursive.sh new file mode 100755 index 0000000..c85cc17 --- /dev/null +++ b/ui/main_recursive.sh @@ -0,0 +1,551 @@ +#!/usr/bin/env bash + +# Demonstrate recursive vs. non-recursive behaviour across dvs add, dvs get, +# and dvs status — both CLI and R package — over a nested file tree. + +set -eu +trap 'printf "ERROR at %s:%d\n" "${BASH_SOURCE[0]}" "$LINENO" >&2' ERR + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" + +# shellcheck source=ui/helpers.sh +source "${SCRIPT_DIR}/helpers.sh" +set -xo pipefail + +say "NOTE: \`just install-all\` should have been called prior to this so the dvs CLI binary on PATH and the installed dvs R package both reflect the current branch." + +# ── Setup: two repos (CLI + R), each with its own storage ── +# All four dirs share one mktemp-generated suffix so it's obvious they belong +# to the same run: dvs_repo_cli_AbC / dvs_storage_cli_AbC / dvs_repo_rpkg_AbC / +# dvs_storage_rpkg_AbC. + +DVS_REPO_CLI="$(mktemp -d "$SCRIPT_DIR"/dvs_repo_cli_XXX)" +RUN_SUFFIX="${DVS_REPO_CLI##*_}" +DVS_STORAGE_CLI="$SCRIPT_DIR/dvs_storage_cli_$RUN_SUFFIX" +DVS_REPO_RPKG="$SCRIPT_DIR/dvs_repo_rpkg_$RUN_SUFFIX" +DVS_STORAGE_RPKG="$SCRIPT_DIR/dvs_storage_rpkg_$RUN_SUFFIX" +mkdir "$DVS_STORAGE_CLI" "$DVS_REPO_RPKG" "$DVS_STORAGE_RPKG" + +# ── Init ── + +cd "$DVS_REPO_CLI" +dvs init "$DVS_STORAGE_CLI" + +cd "$DVS_REPO_RPKG" +print_eval_rscript <