Group keymap harnesses under development/tests/
CI / cargo fmt --check (push) Successful in 27s
CI / cargo clippy (push) Successful in 34s
CI / cargo test (push) Successful in 35s
CI / cargo fmt --check (pull_request) Successful in 32s
CI / cargo clippy (pull_request) Successful in 28s
CI / cargo test (pull_request) Successful in 33s
CI / editor keymaps (push) Successful in 1m27s
CI / editor keymaps (pull_request) Successful in 1m27s

Move the four keymap-harness files (test-keymaps.sh/.lua and the Vim
counterparts) into a development/tests/ subfolder so they sit apart from
the interactive dev launchers. REPO_ROOT now climbs two levels, and the
internal source paths, CI invocations, and ONBOARDING tree are updated.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 14:40:37 -03:00
parent f32f54e8a8
commit 088cf81bcb
6 changed files with 18 additions and 17 deletions
+2 -2
View File
@@ -93,6 +93,6 @@ jobs:
sudo apt-get install -y --no-install-recommends vim
vim --version | head -1
- name: run Neovim keymap harness
run: ./development/test-keymaps.sh
run: ./development/tests/test-keymaps.sh
- name: run Vim keymap harness
run: ./development/test-keymaps-vim.sh
run: ./development/tests/test-keymaps-vim.sh
+5 -4
View File
@@ -74,11 +74,12 @@ nuwiki/
│ ├── start-nvim.sh # Launch Neovim against a scratch wiki
│ ├── start-vim.sh # Launch Vim against a scratch wiki
│ ├── test-personal-wiki.sh # Launch Vim against your real wiki
│ ├── test-keymaps.sh # Neovim keymap harness (CI)
│ ├── syntax-diag.vim # Dump highlighting state for debugging
│ └── tests/ # Editor keymap/command harnesses (run in CI)
│ ├── test-keymaps.sh # Neovim keymap harness
│ ├── test-keymaps.lua
│ ├── test-keymaps-vim.sh # Vim keymap harness (CI)
── test-keymaps-vim.vim
│ └── syntax-diag.vim # Dump highlighting state for debugging
├── test-keymaps-vim.sh # Vim keymap harness
── test-keymaps-vim.vim
└── .gitea/
└── workflows/
@@ -1,16 +1,16 @@
#!/usr/bin/env bash
#
# development/test-keymaps-vim.sh — Vim counterpart of test-keymaps.sh.
# development/tests/test-keymaps-vim.sh — Vim counterpart of test-keymaps.sh.
#
# Pure-VimL portion only. The LSP-roundtrip keymaps (`<C-Space>`,
# `=`, `-`, …) talk to the server via vim-lsp's timer-driven async
# layer, which doesn't fire reliably inside `vim -e -s`. Those have
# Neovim coverage in development/test-keymaps.lua, exercising the same
# Neovim coverage in development/tests/test-keymaps.lua, exercising the same
# Lua command layer + server binary.
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
TMP="$(mktemp -d -t nuwiki-keymap-vim-test-XXXXXX)"
trap 'rm -rf "$TMP"' EXIT
@@ -47,7 +47,7 @@ log "running harness…"
# `</dev/null` so Vim's ex-mode doesn't hang waiting on stdin;
# `timeout` so a misbehaving script can't stall CI for 30 minutes.
NUWIKI_KEYMAP_RESULTS="$RESULTS" \
timeout 30 vim -e -s -u "$VIMRC" -c "edit $SEED" -c "source $REPO_ROOT/development/test-keymaps-vim.vim" \
timeout 30 vim -e -s -u "$VIMRC" -c "edit $SEED" -c "source $REPO_ROOT/development/tests/test-keymaps-vim.vim" \
</dev/null >"$TMP/vim.log" 2>&1 || true
if [[ ! -f "$RESULTS" ]]; then
@@ -1,4 +1,4 @@
" development/test-keymaps-vim.vim — driven by development/test-keymaps-vim.sh.
" development/tests/test-keymaps-vim.vim — driven by development/tests/test-keymaps-vim.sh.
"
" Pure-VimL keymap regression suite. Plain Vim's LSP path
" (vim-lsp + async.vim) talks to the server via timers, which won't
@@ -6,7 +6,7 @@
" are restricted to the bindings whose RHS is implemented entirely in
" VimL (header/link nav, `o`/`O` bullet continuation, the wrap step
" of `<CR>`). LSP-roundtrip bindings (`<C-Space>`, `=`, `-`, …) get
" their coverage from the Neovim harness in development/test-keymaps.lua
" their coverage from the Neovim harness in development/tests/test-keymaps.lua
" — same Lua codepath, same server.
let s:results = []
@@ -1,4 +1,4 @@
-- development/test-keymaps.lua — driven by development/test-keymaps.sh.
-- development/tests/test-keymaps.lua — driven by development/tests/test-keymaps.sh.
--
-- Headless Neovim harness for the buffer-local keymaps registered by
-- `ftplugin/vimwiki.vim` + `lua/nuwiki/keymaps.lua`. Each case sets up
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
# development/test-keymaps.sh — drive development/test-keymaps.lua under
# development/tests/test-keymaps.sh — drive development/tests/test-keymaps.lua under
# headless Neovim and report pass/fail per buffer-local keymap.
#
# The Lua harness needs a real LSP attachment (most keymaps dispatch
@@ -14,7 +14,7 @@
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
TMP="$(mktemp -d -t nuwiki-keymap-test-XXXXXX)"
trap 'rm -rf "$TMP"' EXIT
@@ -53,7 +53,7 @@ log "running harness…"
# stalling CI runners indefinitely.
NUWIKI_KEYMAP_RESULTS="$RESULTS" \
timeout 60 nvim --clean -u "$INIT" --headless "$TMP/wiki/index.wiki" \
-c "luafile $REPO_ROOT/development/test-keymaps.lua" \
-c "luafile $REPO_ROOT/development/tests/test-keymaps.lua" \
>"$TMP/nvim.log" 2>&1 || true
if [[ ! -f "$RESULTS" ]]; then