diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d6c3bb..5b237e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,6 +58,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Check test runner CLI + run: | + scripts/test.sh --help + scripts/test.sh list - name: Run shell and installer tests run: scripts/test.sh shell installer bootstrap diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1f24d..8e9d04f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - `get.sh --dry-run` for safe bootstrap previews before clone/update/install - `CHOPSTICKS_DEST=/absolute/path` to test or install the bootstrap target elsewhere - `scripts/test.sh` local test runner reused by GitHub Actions +- `scripts/test.sh quick`, `--help`, and `list` for easier local test discovery ### Fixed @@ -59,6 +60,7 @@ - Bootstrap dry-run now refuses unrelated existing git repos before any writes - CI now shares shell, installer, bootstrap, docs, and Vim smoke checks with the local test runner +- CI now checks the test runner help and group-list commands - Skip 2 more built-in plugins: openPlugin, manpager (10 → 12 total) - Remove deprecated `set ttyfast` (no-op since Vim 8) - Add `grepprg=rg --vimgrep` — `:grep` now uses ripgrep + quickfix diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4746afc..8f35c42 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,10 +19,12 @@ ## Local tests ```bash -scripts/test.sh shell docs installer bootstrap +scripts/test.sh --help +scripts/test.sh quick scripts/test.sh vim ``` +`scripts/test.sh quick` runs shell, docs, installer, and bootstrap checks without requiring Vim plugins. `scripts/test.sh vim` expects plugins to be installed under `~/.vim/plugged`. Use `STARTUP_LIMIT_MS=150 scripts/test.sh vim` to match CI's startup threshold. diff --git a/scripts/test.sh b/scripts/test.sh index 17f351e..f6b70ba 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -27,6 +27,29 @@ need() { } } +usage() { + cat <<'EOF' +Usage: scripts/test.sh [group...] + +Groups: + quick shell, docs, installer, and bootstrap checks + shell shell syntax, executability, and shellcheck + docs markdownlint for project docs + installer install.sh dry-run/configure-only profile checks + bootstrap get.sh dry-run safety checks + vim Vim smoke tests; requires plugins in ~/.vim/plugged + all quick plus vim + +Options: + -h, --help show this help + list print group names, one per line +EOF +} + +list_groups() { + printf '%s\n' quick shell docs installer bootstrap vim all +} + check_shell() { step "Shell syntax and lint" need bash @@ -194,20 +217,27 @@ check_vim() { run_group() { case "$1" in + quick) + check_shell + check_docs + check_installer_modes + check_bootstrap + ;; shell) check_shell ;; docs) check_docs ;; installer) check_installer_modes ;; bootstrap) check_bootstrap ;; vim) check_vim ;; all) - check_shell - check_docs - check_installer_modes - check_bootstrap + run_group quick check_vim ;; + list | --list) list_groups ;; + -h | --help) usage ;; *) - echo "Usage: scripts/test.sh [shell|docs|installer|bootstrap|vim|all]..." >&2 + echo "Unknown test group: $1" >&2 + echo >&2 + usage >&2 exit 1 ;; esac }