build: migrate test framework from plenary to busted
Problem: plenary.nvim is deprecated. The test suite depends on plenary's async test runner and coroutine-based utilities, tying the project to an unmaintained dependency. CI also tests against Neovim 0.8-0.11, which are no longer relevant. Solution: replace plenary with busted + nlua (nvim -l). Convert all async test patterns (a.wrap, a.util.sleep, a.util.scheduler) to synchronous equivalents using vim.wait. Rename tests/ to spec/ to follow busted convention. Replace the CI test matrix with nvim-busted-action targeting stable/nightly only. Add .busted config, luarocks test_dependencies, and update the nix devshell.
This commit is contained in:
parent
a4da206b67
commit
6be0148eef
28 changed files with 257 additions and 298 deletions
16
.github/workflows/install_nvim.sh
vendored
16
.github/workflows/install_nvim.sh
vendored
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
version="${NVIM_TAG-stable}"
|
||||
dl_name="nvim-linux-x86_64.appimage"
|
||||
# The appimage name changed in v0.10.4
|
||||
if python -c 'from packaging.version import Version; import sys; sys.exit(not (Version(sys.argv[1]) < Version("v0.10.4")))' "$version" 2>/dev/null; then
|
||||
dl_name="nvim.appimage"
|
||||
fi
|
||||
curl -sL "https://github.com/neovim/neovim/releases/download/${version}/${dl_name}" -o nvim.appimage
|
||||
chmod +x nvim.appimage
|
||||
./nvim.appimage --appimage-extract >/dev/null
|
||||
rm -f nvim.appimage
|
||||
mkdir -p ~/.local/share/nvim
|
||||
mv squashfs-root ~/.local/share/nvim/appimage
|
||||
sudo ln -s "$HOME/.local/share/nvim/appimage/AppRun" /usr/bin/nvim
|
||||
/usr/bin/nvim --version
|
||||
32
.github/workflows/tests.yml
vendored
32
.github/workflows/tests.yml
vendored
|
|
@ -12,7 +12,7 @@ on:
|
|||
jobs:
|
||||
selene:
|
||||
name: Selene
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: NTBBloodbath/selene-action@v1.0.0
|
||||
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
|
||||
stylua:
|
||||
name: StyLua
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Stylua
|
||||
|
|
@ -30,11 +30,11 @@ jobs:
|
|||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: v2.1.0
|
||||
args: --check lua tests
|
||||
args: --check lua spec
|
||||
|
||||
typecheck:
|
||||
name: typecheck
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: mrcjkb/lua-typecheck-action@v0
|
||||
|
|
@ -45,24 +45,16 @@ jobs:
|
|||
|
||||
run_tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- nvim_tag: v0.8.3
|
||||
- nvim_tag: v0.9.4
|
||||
- nvim_tag: v0.10.4
|
||||
- nvim_tag: v0.11.0
|
||||
nvim_version:
|
||||
- stable
|
||||
- nightly
|
||||
|
||||
name: Run tests
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
NVIM_TAG: ${{ matrix.nvim_tag }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Neovim and dependencies
|
||||
run: |
|
||||
bash ./.github/workflows/install_nvim.sh
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
bash ./run_tests.sh
|
||||
- uses: nvim-neorocks/nvim-busted-action@v1
|
||||
with:
|
||||
nvim_version: ${{ matrix.nvim_version }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue