1- packpath := justfile_directory () / " packpath"
21scripts := justfile_directory () / " scripts"
32doc := justfile_directory () / " doc"
43devcontainer := justfile_directory () / " .devcontainer/lazyvim/Dockerfile"
@@ -8,23 +7,23 @@ spec := justfile_directory() / "spec"
87fixtures := spec / " fixtures"
98demos := justfile_directory () / " demos"
109
11- init_lua := scripts / " minimal_init.lua "
12- clean_config := justfile_directory () / " .test-config "
10+ export LEAN_NVIM_ISOLATED_CONFIG_ROOT := justfile_directory () / " .isolated_config_for_tests "
11+ packpath := LEAN_NVIM_ISOLATED_CONFIG_ROOT / " local/share/nvim/site/pack/testing/start "
1312
1413# Run the lean.nvim test suite.
1514[group (' testing' )]
16- test : _rebuild-test-fixtures _clone-test -dependencies
17- @ just retest
15+ test * ARGS = ' ' : _rebuild-test-fixtures _clone-dependencies
16+ @ just retest {{ ARGS }}
1817
1918# Run the test suite without rebuilding or recloning any dependencies.
2019[group (' testing' )]
21- retest * test_files = spec :
22- XDG_CONFIG_HOME= " {{ clean_config }} " nvim --headless --clean -u {{ init_lua }} -c ' lua require("inanis").run{ specs = vim.split(" {{ test_files }} ", " "), minimal_init = " {{ init_lua }} ", sequential = vim.env.TEST_SEQUENTIAL ~= nil }'
20+ retest * ARGS = ' ' :
21+ eval $(luarocks path --no-bin --lua-version 5.1 ); luarocks -- lua-version 5.1 test -- {{ ARGS }}
2322
24- # Run an instance of neovim with the same minimal init used to run tests.
23+ # Run an instance of neovim with the same setup used to run tests.
2524[group (' dev' )]
2625nvim * ARGS = ' ':
27- XDG_CONFIG_HOME=" {{ clean_config }} " nvim --clean -u {{ init_lua }} -c " lua require('lean').setup { mappings = true }" {{ ARGS }}
26+ XDG_CONFIG_HOME=" {{ LEAN_NVIM_ISOLATED_CONFIG_ROOT }} "/ config nvim --clean -u NONE -c " lua require('lean').setup { mappings = true }" {{ ARGS }}
2827
2928# Run an instance of the `devcontainer` which uses LazyVim.
3029[group (' dev' )]
@@ -40,7 +39,7 @@ scratch *ARGS='':
4039
4140# Coarsely profile how long the whole test suite takes to run.
4241[group (' testing' )]
43- profile-test * ARGS : _rebuild-test-fixtures _clone-test- dependencies
42+ profile-test * ARGS : _rebuild-test-fixtures _clone-dependencies
4443 hyperfine --warmup 2 {{ ARGS }} " just retest"
4544
4645# Lint lean.nvim for style and typing issues.
5049 {{ if ` lua-language-server --version 2>&1 > /dev/null; echo $? ` != " 0" { error (' lua-language-server not found' ) } else { " " } }}
5150 lua-language-server --check {{ lean }} --checklevel=Warning --configpath " {{ justfile_directory () }} /.luarc.json"
5251 {{ if ` selene --version 2>&1 > /dev/null; echo $? ` != " 0" { error (' selene not found' ) } else { " " } }}
53- selene {{ src }}
52+ selene {{ src }} {{ spec }}
5453
5554# Rebuild a demo from our VHS script.
5655demo :
7372 {{ lean }} / stderr.lua \
7473 {{ lean }} / sorry.lua \
7574 >{{ doc }} / lean.txt
76- nvim --headless --clean -u {{ init_lua }} -c ' helptags {{ doc }} ' -c ' quit'
75+ nvim --headless --clean -u NONE -c ' helptags {{ doc }} ' -c ' quit'
7776
7877# Update the versions of test fixtures used in CI.
7978[group (' testing' )]
@@ -86,19 +85,13 @@ bump-test-fixtures:
8685
8786# Delete any previously cloned dependencies.
8887_ clean-dependencies :
89- rm -rf ' {{ packpath }} '
90- mkdir ' {{ packpath }} '
88+ rm -rf ' {{ LEAN_NVIM_ISOLATED_CONFIG_ROOT }} '
9189
9290# Clone any neovim dependencies required for the plugin.
9391_ clone-dependencies : _clean-dependencies
94- for dependency in AndrewRadev/ switch.vim andymass/ vim-matchup neovim/ nvim-lspconfig nvim-lua/ plenary.nvim tomtom/ tcomment_vim lewis6991 / satellite.nvim; do \
95- git clone --quiet --filter=blob:none " https://github.com/$dependency" " {{ packpath }} /$(basename $dependency)" ; \
96- done
97-
98- # Clone any neovim dependencies required for the test suite.
99- _ clone-test-dependencies : _clone-dependencies
100- for dependency in Julian/ inanis.nvim; do \
101- git clone --quiet --filter=blob:none " https://github.com/$dependency" " {{ packpath }} /$(basename $dependency)" ; \
92+ mkdir -p ' {{ packpath }} ' && ln -s " {{ justfile_directory () }} " " {{ packpath }} "
93+ for dependency in AndrewRadev/ switch.vim andymass/ vim-matchup tomtom/ tcomment_vim lewis6991 / satellite.nvim; do \
94+ git clone --quiet --filter=blob:none " https://github.com/$dependency" " {{ packpath }} /$(basename $dependency)" ; \
10295 done
10396
10497# Rebuild some test fixtures used in the test suite.
0 commit comments