Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

. "$(dirname "$0")/test-helper.sh"

IDSTACK_DIR="$(cd "$(dirname "$0")/.." && pwd)"
IDSTACK_DIR="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}"
TEST_DIR=$(mktemp -d)
# Single-quoted so expansion happens at trap time and a path with spaces survives.
trap 'rm -rf "$TEST_DIR"' EXIT
Expand Down
14 changes: 7 additions & 7 deletions test/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ fi
check "bin/idstack-manifest-merge exists" "[ -f '$IDSTACK_DIR/bin/idstack-manifest-merge' ]"
check "bin/idstack-manifest-merge is executable" "[ -x '$IDSTACK_DIR/bin/idstack-manifest-merge' ]"
if [ -x "$IDSTACK_DIR/test/test-manifest-merge.sh" ]; then
check "manifest-merge unit tests pass" "'$IDSTACK_DIR/test/test-manifest-merge.sh'"
check "manifest-merge unit tests pass" "'$IDSTACK_DIR/test/test-manifest-merge.sh' '$IDSTACK_DIR'"
fi

# Version classifier (shared by setup + bin/idstack-doctor) must classify
Expand All @@ -285,7 +285,7 @@ check "setup sources the shared version classifier" "grep -q 'lib/version-classi
check "idstack-doctor sources the shared version classifier" "grep -q 'lib/version-classify.sh' '$IDSTACK_DIR/bin/idstack-doctor'"
check "version-classifier test sources the shared classifier" "grep -q 'lib/version-classify.sh' '$IDSTACK_DIR/test/test-version-classifier.sh'"
if [ -x "$IDSTACK_DIR/test/test-version-classifier.sh" ]; then
check "version-classifier unit tests pass" "'$IDSTACK_DIR/test/test-version-classifier.sh'"
check "version-classifier unit tests pass" "'$IDSTACK_DIR/test/test-version-classifier.sh' '$IDSTACK_DIR'"
fi

# `claude plugin list` parsing, also extracted to bin/lib/ so it is testable.
Expand All @@ -294,16 +294,16 @@ check "bin/lib/plugin-status.sh exists" "[ -f '$IDSTACK_DIR/bin/lib/plugin-statu
check "idstack-doctor sources the shared plugin-status parser" "grep -q 'lib/plugin-status.sh' '$IDSTACK_DIR/bin/idstack-doctor'"
check "idstack-doctor no longer uses a fixed -A4 window" "! grep -q 'grep -A4' '$IDSTACK_DIR/bin/idstack-doctor'"
if [ -x "$IDSTACK_DIR/test/test-plugin-status.sh" ]; then
check "plugin-status unit tests pass" "'$IDSTACK_DIR/test/test-plugin-status.sh'"
check "plugin-status unit tests pass" "'$IDSTACK_DIR/test/test-plugin-status.sh' '$IDSTACK_DIR'"
fi
# Hooked in here as well as in CI because release.yml's gate runs only
# smoke-test.sh — doctor's branches would otherwise be unverified at release.
if [ -x "$IDSTACK_DIR/test/test-doctor.sh" ]; then
check "doctor behavioral tests pass" "'$IDSTACK_DIR/test/test-doctor.sh'"
check "doctor behavioral tests pass" "'$IDSTACK_DIR/test/test-doctor.sh' '$IDSTACK_DIR'"
fi
# --readiness is the pre-export gate; same reasoning as doctor above.
if [ -x "$IDSTACK_DIR/test/test-status.sh" ]; then
check "idstack-status behavioral tests pass" "'$IDSTACK_DIR/test/test-status.sh'"
check "idstack-status behavioral tests pass" "'$IDSTACK_DIR/test/test-status.sh' '$IDSTACK_DIR'"
fi

# ./setup is what a new user runs first; it is exercised against a repo copy
Expand All @@ -314,7 +314,7 @@ fi

# Chrome extension unit and integration tests
if [ -x "$IDSTACK_DIR/test/test-extension.sh" ]; then
check "chrome extension tests pass" "'$IDSTACK_DIR/test/test-extension.sh'"
check "chrome extension tests pass" "'$IDSTACK_DIR/test/test-extension.sh' '$IDSTACK_DIR'"
fi

# Responsive landing page test
Expand Down Expand Up @@ -346,7 +346,7 @@ check "preamble supports CLAUDE_PLUGIN_ROOT" "grep -q 'CLAUDE_PLUGIN_ROOT' '$IDS
# (macOS system python3 is 3.9) — a SyntaxError there dies silently behind
# `2>/dev/null || true` in every generated skill.
if [ -x "$IDSTACK_DIR/test/test-preamble-python.sh" ]; then
check "preamble embedded-python tests pass" "'$IDSTACK_DIR/test/test-preamble-python.sh'"
check "preamble embedded-python tests pass" "'$IDSTACK_DIR/test/test-preamble-python.sh' '$IDSTACK_DIR'"
fi

# Migration tests. One tempdir root cleaned by trap; every cp + migrate runs
Expand Down
4 changes: 2 additions & 2 deletions test/test-doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -e

. "$(dirname "$0")/test-helper.sh"

REPO_DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
REPO_DIR="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}"
TEST_ROOT="$(mktemp -d)"
trap 'rm -rf "$TEST_ROOT"' EXIT

Expand All @@ -40,7 +40,7 @@ DOCTOR_CMD="$MOCK_IDSTACK_DIR/bin/idstack-doctor"
# mock we drop in. `claude` is absent unless a test installs it.
MOCK_BIN="$TEST_ROOT/bin"
mkdir -p "$MOCK_BIN"
for _c in bash sh env command dirname echo grep head python3 readlink sed tr awk cat ls rm mkdir ln chmod mktemp printf sort wc basename find touch cp; do
for _c in bash sh env command dirname echo grep head python3 readlink sed tr awk cat ls rm mkdir ln chmod mktemp printf sort wc basename find touch cp cut; do
_p=$(command -v "$_c" 2>/dev/null) && ln -sf "$_p" "$MOCK_BIN/$_c"
done
export PATH="$MOCK_BIN"
Expand Down
2 changes: 1 addition & 1 deletion test/test-extension.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

DIR="$(cd "$(dirname "$0")" && pwd)"
DIR="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}/test"

echo "==> Running idstack Chrome Extension test suite..."
node "$DIR/test-manifest.js"
Expand Down
4 changes: 2 additions & 2 deletions test/test-manifest-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -e

. "$(dirname "$0")/test-helper.sh"

REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
REPO_ROOT="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}"
MERGE="$REPO_ROOT/bin/idstack-manifest-merge"

# Skip the suite if python3 is missing (the tool requires python3).
Expand Down Expand Up @@ -126,7 +126,7 @@ check "manifest with string root exits 2" "[ $EC -eq 2 ]"
# --- idstack-migrate --init: the manifest bootstrap the merge tool depends on ---
# Skills running standalone create the manifest with --init before merging;
# without it the merge exits 4 and standalone results are never persisted.
MIGRATE="$(cd "$(dirname "$0")/.." && pwd -P)/bin/idstack-migrate"
MIGRATE="$REPO_ROOT/bin/idstack-migrate"

INIT_DIR="$WORK/initcase"
mkdir -p "$INIT_DIR/.idstack"
Expand Down
2 changes: 1 addition & 1 deletion test/test-plugin-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set -e

. "$(dirname "$0")/test-helper.sh"

IDSTACK_DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
IDSTACK_DIR="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}"
. "$IDSTACK_DIR/bin/lib/plugin-status.sh"

# Domain-specific shape: feeds a `claude plugin list` listing to
Expand Down
2 changes: 1 addition & 1 deletion test/test-preamble-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -e

. "$(dirname "$0")/test-helper.sh"

IDSTACK_DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
IDSTACK_DIR="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}"

echo "test-preamble-python"
echo " python3: $(python3 --version 2>&1 || echo 'not found')"
Expand Down
2 changes: 1 addition & 1 deletion test/test-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -e

. "$(dirname "$0")/test-helper.sh"

REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
REPO_ROOT="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}"
STATUS="$REPO_ROOT/bin/idstack-status"

if ! command -v python3 >/dev/null 2>&1; then
Expand Down
2 changes: 1 addition & 1 deletion test/test-version-classifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -e

. "$(dirname "$0")/test-helper.sh"

IDSTACK_DIR="$(cd "$(dirname "$0")/.." && pwd -P)"
IDSTACK_DIR="${1:-$(cd "$(dirname "$0")/.." && pwd -P)}"
. "$IDSTACK_DIR/bin/lib/version-classify.sh"

# Domain-specific shape: this compares a version string to an expected
Expand Down
Loading