Skip to content

Commit

Permalink
Merge branch 'master' into docs/neotest-bash
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarriga authored Dec 21, 2023
2 parents e22c054 + a2f1cb4 commit bf3e8f3
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 44 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/luarocks-release.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
---
on:
release:
types: [published]
types:
- created
push:
tags:
- '*'
workflow_dispatch: # Allow manual trigger
pull_request: # Tests the luarocks installation without releasing on PR

jobs:
luarocks-upload:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Version
# tags do not trigger the workflow when they are created by other workflows or releases
run: echo "LUAROCKS_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: LuaRocks Upload
uses: nvim-neorocks/luarocks-tag-release@v4
uses: nvim-neorocks/luarocks-tag-release@v5
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}
with:
dependencies: |
plenary.nvim
nvim-treesitter
with:
version: ${{ env.LUAROCKS_VERSION }}
dependencies: |
plenary.nvim
60 changes: 33 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Install with your favourite package manager alongside nvim-dap
call dein#add("nvim-lua/plenary.nvim")
call dein#add("antoinemadec/FixCursorHold.nvim")
call dein#add("nvim-neotest/neotest")
call dein#add("nvim-treesitter/nvim-treesitter")
```

[**vim-plug**](https://github.com/junegunn/vim-plug)
Expand All @@ -55,6 +56,7 @@ call dein#add("nvim-neotest/neotest")
Plug 'nvim-lua/plenary.nvim'
Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'nvim-neotest/neotest'
Plug 'nvim-treesitter/nvim-treesitter'
```

[packer.nvim](https://github.com/wbthomason/packer.nvim)
Expand All @@ -64,7 +66,8 @@ use {
"nvim-neotest/neotest",
requires = {
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim"
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter"
}
}
```
Expand All @@ -76,7 +79,8 @@ use {
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim"
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter"
}
}
```
Expand All @@ -86,31 +90,33 @@ See the adapter's documentation for their specific setup instructions.

### Supported Runners

| Test Runner | Adapter |
| :-------------- | :------------------------------------------------------------------: |
| pytest | [neotest-python](https://github.com/nvim-neotest/neotest-python) |
| python-unittest | [neotest-python](https://github.com/nvim-neotest/neotest-python) |
| plenary | [neotest-plenary](https://github.com/nvim-neotest/neotest-plenary) |
| go | [neotest-go](https://github.com/akinsho/neotest-go) |
| jest | [neotest-jest](https://github.com/haydenmeade/neotest-jest) |
| vitest | [neotest-vitest](https://github.com/marilari88/neotest-vitest) |
| playwright | [neotest-playwright](https://github.com/thenbe/neotest-playwright) |
| rspec | [neotest-rspec](https://github.com/olimorris/neotest-rspec) |
| minitest | [neotest-minitest](https://github.com/zidhuss/neotest-minitest) |
| dart, flutter | [neotest-dart](https://github.com/sidlatau/neotest-dart) |
| testthat | [neotest-testthat](https://github.com/shunsambongi/neotest-testthat) |
| phpunit | [neotest-phpunit](https://github.com/olimorris/neotest-phpunit) |
| pest | [neotest-pest](https://github.com/theutz/neotest-pest) |
| rust | [neotest-rust](https://github.com/rouge8/neotest-rust) |
| elixir | [neotest-elixir](https://github.com/jfpedroza/neotest-elixir) |
| dotnet | [neotest-dotnet](https://github.com/Issafalcon/neotest-dotnet) |
| scala | [neotest-scala](https://github.com/stevanmilic/neotest-scala) |
| haskell | [neotest-haskell](https://github.com/mrcjkb/neotest-haskell) |
| deno | [neotest-deno](https://github.com/MarkEmmons/neotest-deno) |
| java | [neotest-java](https://github.com/rcasia/neotest-java) |
| bash | [neotest-bash](https://github.com/rcasia/neotest-bash) |
| foundry | [neotest-foundry](https://github.com/llllvvuu/neotest-foundry) |
| zig | [neotest-zig](https://github.com/lawrence-laz/neotest-zig) |
| Test Runner | Adapter |
| :---------------- | :------------------------------------------------------------------: |
| pytest | [neotest-python](https://github.com/nvim-neotest/neotest-python) |
| python-unittest | [neotest-python](https://github.com/nvim-neotest/neotest-python) |
| plenary | [neotest-plenary](https://github.com/nvim-neotest/neotest-plenary) |
| go | [neotest-go](https://github.com/akinsho/neotest-go) |
| jest | [neotest-jest](https://github.com/haydenmeade/neotest-jest) |
| vitest | [neotest-vitest](https://github.com/marilari88/neotest-vitest) |
| playwright | [neotest-playwright](https://github.com/thenbe/neotest-playwright) |
| rspec | [neotest-rspec](https://github.com/olimorris/neotest-rspec) |
| minitest | [neotest-minitest](https://github.com/zidhuss/neotest-minitest) |
| dart, flutter | [neotest-dart](https://github.com/sidlatau/neotest-dart) |
| testthat | [neotest-testthat](https://github.com/shunsambongi/neotest-testthat) |
| phpunit | [neotest-phpunit](https://github.com/olimorris/neotest-phpunit) |
| pest | [neotest-pest](https://github.com/theutz/neotest-pest) |
| rust | [neotest-rust](https://github.com/rouge8/neotest-rust) |
| elixir | [neotest-elixir](https://github.com/jfpedroza/neotest-elixir) |
| dotnet | [neotest-dotnet](https://github.com/Issafalcon/neotest-dotnet) |
| scala | [neotest-scala](https://github.com/stevanmilic/neotest-scala) |
| haskell | [neotest-haskell](https://github.com/mrcjkb/neotest-haskell) |
| deno | [neotest-deno](https://github.com/MarkEmmons/neotest-deno) |
| java | [neotest-java](https://github.com/rcasia/neotest-java) |
| foundry | [neotest-foundry](https://github.com/llllvvuu/neotest-foundry) |
| zig | [neotest-zig](https://github.com/lawrence-laz/neotest-zig) |
| c++ (google test) | [neotest-gtest](https://github.com/alfaix/neotest-gtest) |
| gradle | [neotest-gradle](https://github.com/weilbith/neotest-gradle) |
| bash | [neotest-bash](https://github.com/rcasia/neotest-bash) |

For any runner without an adapter you can use [neotest-vim-test](https://github.com/nvim-neotest/neotest-vim-test) which supports any runner that vim-test supports.
The vim-test adapter does not support some of the more advanced features such as error locations or per-test output.
Expand Down
25 changes: 18 additions & 7 deletions doc/neotest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ See the table of contents for the consumers


Neotest strategies and consumers
See also~
See also ~
|neotest.Config|

Parameters~
Expand Down Expand Up @@ -189,6 +189,7 @@ Default values:
enabled = true,
symbol_queries = {
elixir = <function 1>,
go = " ;query\n ;Captures imported types\n (qualified_type name: (type_identifier) @symbol)\n ;Captures package-local and built-in types\n (type_identifier)@symbol\n ;Captures imported function calls and variables/constants\n (selector_expression field: (field_identifier) @symbol)\n ;Captures package-local functions calls\n (call_expression function: (identifier) @symbol)\n ",
lua = ' ;query\n ;Captures module names in require calls\n (function_call\n name: ((identifier) @function (#eq? @function "require"))\n arguments: (arguments (string) @symbol))\n ',
python = " ;query\n ;Captures imports and modules they're imported from\n (import_from_statement (_ (identifier) @symbol))\n (import_statement (_ (identifier) @symbol))\n "
}
Expand Down Expand Up @@ -626,7 +627,7 @@ A consumer that displays error messages using the vim.diagnostic API.
This consumer is completely passive and so has no interface.

You can configure the diagnostic API for neotest using the "neotest" namespace
See also~
See also ~
|vim.diagnostic.config()|


Expand All @@ -636,7 +637,7 @@ neotest.summary *neotest.summary*

A consumer that displays the structure of the test suite, along with results and
allows running tests.
See also~
See also ~
|neotest.Config.summary.mappings| for all mappings in the summary window

*neotest.summary.open()*
Expand Down Expand Up @@ -817,7 +818,7 @@ partial: boolean))`
{test_focused} `(fun(adapter_id: string, position_id: string)>)`
{starting} `(fun())`
{started} `(fun())`
Type~
Type ~
neotest.Client

*neotest.client.RunTreeArgs*
Expand Down Expand Up @@ -1073,7 +1074,7 @@ Return~
neotest.lib.files.sep *neotest.lib.files.sep*

Path separator for the current OS
Type~
Type ~
`(string)`

*neotest.lib.files.detect_filetype()*
Expand Down Expand Up @@ -1548,17 +1549,27 @@ Parameters~


==============================================================================
*M.PositionType*
`PositionType`

neotest.PositionType

*neotest.Position*
Fields~
{id} `(string)`
{type} `("dir"|"file"|"namespace"|"test")`
{type} `(neotest.PositionType)`
{name} `(string)`
{path} `(string)`
{range} `(integer[])`

*M.ResultStatus*
`ResultStatus`

neotest.ResultStatus

*neotest.Result*
Fields~
{status} `("passed"|"failed"|"skipped")`
{status} `(neotest.ResultStatus)`
{output?} `(string)` Path to file containing full output data
{short?} `(string)` Shortened output string
{errors?} `(neotest.Error[])`
Expand Down
23 changes: 19 additions & 4 deletions lua/neotest/types/init.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
local M = {}

---@enum neotest.PositionType
M.PositionType = {
dir = "dir",
file = "file",
namespace = "namespace",
test = "test",
}

---@class neotest.Position
---@field id string
---@field type "dir"|"file"|"namespace"|"test"
---@field type neotest.PositionType
---@field name string
---@field path string
---@field range integer[]

---@enum neotest.ResultStatus
M.ResultStatus = {
passed = "passed",
failed = "failed",
skipped = "skipped",
}

---@class neotest.Result
---@field status "passed"|"failed"|"skipped"
---@field status neotest.ResultStatus
---@field output? string Path to file containing full output data
---@field short? string Shortened output string
---@field errors? neotest.Error[]
Expand Down Expand Up @@ -45,8 +62,6 @@
---@field strategy? table|neotest.Strategy Arguments for strategy or override for chosen strategy
---@field stream fun(output_stream: fun(): string[]): fun(): table<string, neotest.Result>

local M = {}

M.Tree = require("neotest.types.tree")
M.FanoutAccum = require("neotest.types.fanout_accum")

Expand Down

0 comments on commit bf3e8f3

Please sign in to comment.