A neotest adapter for Bazel, which aims to be flexible enough for use in large Bazel monorepos.
How does this differ from sluongng/neotest-bazel?
My primary goal is to make this plugin usable in large monorepos, which may otherwise struggle with neotest's discovery while still being flexible enough to enable eager discovery in smaller projects.
In terms of current functionality, sluongng/neotest-bazel will currently run tests from within the language test file (if that language is supported),
while this project will only run tests from the BUILD file which defines the corresponding target.
- Tests cannot be run from the language test file, only the BUILD file which defines the target.
- Within
BUILDfiles, test target location is limited to the row and column of the opening parenthesis (as reported bybazel query) rather than encompassing the entire location.
Running tests requires either
to be installed1.
You can then run:
luarocks test --local
# or
bustedOr if you want to run a single test file:
luarocks test spec/path_to_file.lua --local
# or
busted spec/path_to_file.luaIf you see an error like module 'busted.runner' not found:
eval $(luarocks path --no-bin)- Insipriation taken from: sluongng/neotest-bazel.
Footnotes
-
The test suite assumes that
nluahas been installed using luarocks into~/.luarocks/bin/. ↩