mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-05-10 19:10:59 +08:00
Improve test runner discoverability
This commit is contained in:
parent
67ffdfe99f
commit
259744b5e3
4 changed files with 44 additions and 6 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue