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
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Check test runner CLI
|
||||||
|
run: |
|
||||||
|
scripts/test.sh --help
|
||||||
|
scripts/test.sh list
|
||||||
- name: Run shell and installer tests
|
- name: Run shell and installer tests
|
||||||
run: scripts/test.sh shell installer bootstrap
|
run: scripts/test.sh shell installer bootstrap
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
- `get.sh --dry-run` for safe bootstrap previews before clone/update/install
|
- `get.sh --dry-run` for safe bootstrap previews before clone/update/install
|
||||||
- `CHOPSTICKS_DEST=/absolute/path` to test or install the bootstrap target elsewhere
|
- `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` local test runner reused by GitHub Actions
|
||||||
|
- `scripts/test.sh quick`, `--help`, and `list` for easier local test discovery
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
@ -59,6 +60,7 @@
|
||||||
- Bootstrap dry-run now refuses unrelated existing git repos before any writes
|
- Bootstrap dry-run now refuses unrelated existing git repos before any writes
|
||||||
- CI now shares shell, installer, bootstrap, docs, and Vim smoke checks with
|
- CI now shares shell, installer, bootstrap, docs, and Vim smoke checks with
|
||||||
the local test runner
|
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)
|
- Skip 2 more built-in plugins: openPlugin, manpager (10 → 12 total)
|
||||||
- Remove deprecated `set ttyfast` (no-op since Vim 8)
|
- Remove deprecated `set ttyfast` (no-op since Vim 8)
|
||||||
- Add `grepprg=rg --vimgrep` — `:grep` now uses ripgrep + quickfix
|
- Add `grepprg=rg --vimgrep` — `:grep` now uses ripgrep + quickfix
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,12 @@
|
||||||
## Local tests
|
## Local tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
scripts/test.sh shell docs installer bootstrap
|
scripts/test.sh --help
|
||||||
|
scripts/test.sh quick
|
||||||
scripts/test.sh vim
|
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`.
|
`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.
|
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() {
|
check_shell() {
|
||||||
step "Shell syntax and lint"
|
step "Shell syntax and lint"
|
||||||
need bash
|
need bash
|
||||||
|
|
@ -194,20 +217,27 @@ check_vim() {
|
||||||
|
|
||||||
run_group() {
|
run_group() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
quick)
|
||||||
|
check_shell
|
||||||
|
check_docs
|
||||||
|
check_installer_modes
|
||||||
|
check_bootstrap
|
||||||
|
;;
|
||||||
shell) check_shell ;;
|
shell) check_shell ;;
|
||||||
docs) check_docs ;;
|
docs) check_docs ;;
|
||||||
installer) check_installer_modes ;;
|
installer) check_installer_modes ;;
|
||||||
bootstrap) check_bootstrap ;;
|
bootstrap) check_bootstrap ;;
|
||||||
vim) check_vim ;;
|
vim) check_vim ;;
|
||||||
all)
|
all)
|
||||||
check_shell
|
run_group quick
|
||||||
check_docs
|
|
||||||
check_installer_modes
|
|
||||||
check_bootstrap
|
|
||||||
check_vim
|
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 ;;
|
exit 1 ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue