Skip to content

Commit

Permalink
chore: refactor tests to hopefully pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ryall committed Dec 28, 2023
1 parent 625005d commit 88bbd7e
Show file tree
Hide file tree
Showing 44 changed files with 25 additions and 16 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ jobs:

- name: install plenary.nvim
run: |
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary
# git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
- name: run test
- name: setup tools
shell: bash
run: |
luarocks install luacheck
luarocks install vusted
vusted
- name: Run tests
shell: bash
env:
VUSTED_NVIM: ${{ steps.vim.outputs.executable }}
VUSTED_ARGS: "--headless"
run: |
make test
17 changes: 8 additions & 9 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
self = false

ignore = {
}
read_globals = {
"vim",
"describe",
"it",
"assert"
globals = {
'vim',
'describe',
'it',
'before_each',
'after_each',
'assert',
'async',
}
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# GIT_WORKTREE_NVIM_LOG=fatal
.PHONY: test
test:
GIT_WORKTREE_NVIM_LOG=fatal nvim --headless --noplugin -u tests/minimal_init.vim -c "PlenaryBustedDirectory tests/ { minimal_init = './tests/minimal_init.vim' }"
vusted --output=gtest ./lua
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/git_spec.lua → lua/git-worktree/git_spec.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local git_harness = require('util.git_harness')
local git_harness = require('git-worktree.test.git_util')
local gwt_git = require('git-worktree.git')
local Status = require('git-worktree.status')

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local system = require('util.system')
local system = require('git-worktree.test.system_util')

local M = {}

Expand All @@ -11,7 +11,7 @@ function M.setup_origin_repo()

local workspace_dir = system.create_temp_dir('workspace-dir')
vim.api.nvim_set_current_dir(vim.fn.getcwd())
system.run('cp -r spec/.repo ' .. workspace_dir)
system.run('cp -r test/fixtures/.repo ' .. workspace_dir)
vim.api.nvim_set_current_dir(workspace_dir)
system.run([[
mv .repo/.git-orig ./.git
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 88bbd7e

Please sign in to comment.