Skip to content

Commit

Permalink
feat: plenary
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed May 11, 2024
1 parent d9d8eae commit 40060ec
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 161 deletions.
17 changes: 0 additions & 17 deletions .busted

This file was deleted.

23 changes: 9 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ jobs:
with:
neovim: true
version: ${{ matrix.version }}
- name: Set up pkgx with LuaJIT and LuaRocks
uses: pkgxdev/setup@v1
with:
+: luajit.org@2 luarocks.org

# Install into LuaRocks (not Neovim)
- name: Install neotest
run: luarocks --lua-dir=$HOME/.pkgx/luajit.org/v2 --lua-version=5.1 install neotest
- name: Install nvim-treesitter
run: luarocks --lua-dir=$HOME/.pkgx/luajit.org/v2 --lua-version=5.1 install nvim-treesitter
- name: Install busted
run: luarocks --lua-dir=$HOME/.pkgx/luajit.org/v2 --lua-version=5.1 install busted

- name: Neovim version
run: nvim --version
- name: Install dependencies
run: ./test/install.sh
- name: Run Init
run: nvim --headless -c 'lua require("test.minimal_init")'
- name: Run TSInstall
run: nvim --headless -c 'TSInstallSync lua go | quit'
- name: Run tests
run: make unit-test
run: nvim --headless -c "lua PlenaryBustedDirectory test {minimal_init = 'test/minimal_init.lua', sequential = true}" -c "qa!"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
test/xdg
.tests
4 changes: 0 additions & 4 deletions .luarc.json

This file was deleted.

2 changes: 0 additions & 2 deletions .nvimrc

This file was deleted.

3 changes: 0 additions & 3 deletions .pkgx.yml

This file was deleted.

15 changes: 0 additions & 15 deletions Makefile

This file was deleted.

34 changes: 0 additions & 34 deletions test/busted

This file was deleted.

32 changes: 32 additions & 0 deletions test/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
set -e

# This script is executed via tests/minimal_init.lua

GITHUB="https://github.com"
GITHUB_PLENARY="$GITHUB/nvim-lua/plenary.nvim"
GITHUB_TELESCOPE="$GITHUB/nvim-telescope/telescope.nvim"
GITHUB_LSPCONFIG="$GITHUB/neovim/nvim-lspconfig"
GITHUB_NIO="$GITHUB/nvim-neotest/nvim-nio"
GITHUB_NEOTEST="$GITHUB/nvim-neotest/neotest"

SCRIPT_FILE=$(readlink -f "${BASH_SOURCE[0]}")
REPO_DIR=$(dirname "$(dirname "$SCRIPT_FILE")")

TEST_ALL_DIR="$REPO_DIR/.tests/all/site/pack/deps/start"

clone() {
repo=$1
dest=$2
if [ ! -d "$dest" ]; then
git clone --depth 1 "$repo" "$dest"
fi
}

# Just for the main minimal_init.lua for neotest
mkdir -p $TEST_ALL_DIR
clone $GITHUB_PLENARY "$TEST_ALL_DIR/plenary.nvim"
clone $GITHUB_LSPCONFIG "$TEST_ALL_DIR/lspconfig.nvim"
clone $GITHUB_TELESCOPE "$TEST_ALL_DIR/telescope.nvim"
clone $GITHUB_NIO "$TEST_ALL_DIR/nvim-nio"
clone $GITHUB_NEOTEST "$TEST_ALL_DIR/neotest"
27 changes: 27 additions & 0 deletions test/minimal_init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local M = {}

-- function M.root(root)
-- local f = debug.getinfo(1, "S").source:sub(2)
-- return vim.fn.fnamemodify(f, ":p:h:h") .. "/" .. (root or "")
-- end

function M.init()
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.opt.runtimepath:append(".")
vim.opt.swapfile = false

vim.opt.packpath = {
".tests/all/site",
}

vim.cmd([[
packadd plenary.nvim
packadd neotest
packadd nvim-nio
]])
end

-- Ensure the required Neovim plugins are installed/cloned
os.execute("test/install.sh")

M.init()
71 changes: 0 additions & 71 deletions test/nvim-shim

This file was deleted.

0 comments on commit 40060ec

Please sign in to comment.