From 3f3784f2676f5f594410a9754e67237d97106b37 Mon Sep 17 00:00:00 2001 From: Arsen Kitov Date: Sun, 10 Dec 2023 20:12:52 +0100 Subject: [PATCH 1/5] doc(readme): add neotest-gtest (#331) --- README.md | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 57d1b5fe..5977214c 100644 --- a/README.md +++ b/README.md @@ -87,29 +87,30 @@ 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) | -| foundry | [neotest-foundry](https://github.com/llllvvuu/neotest-foundry) | -| zig | [neotest-zig](https://github.com/lawrence-laz/neotest-zig) | +| :---------------- | :------------------------------------------------------------------: | +| 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) | 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. From b4b6917ea00dd59112dd137acfcd0f1da255ef7f Mon Sep 17 00:00:00 2001 From: Thore Strassburg Date: Sun, 10 Dec 2023 20:25:58 +0100 Subject: [PATCH 2/5] docs(README): Gradle runner (#328) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5977214c..072a5d5a 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ See the adapter's documentation for their specific setup instructions. | 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) | 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. From 8782d83869c64700fa419bd5278f4f62c80a2c1a Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Sun, 10 Dec 2023 20:29:12 +0100 Subject: [PATCH 3/5] ci: fix luarocks-release workflow (#307) --- .github/workflows/luarocks-release.yaml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/luarocks-release.yaml b/.github/workflows/luarocks-release.yaml index 63dcd787..a11cb9ec 100644 --- a/.github/workflows/luarocks-release.yaml +++ b/.github/workflows/luarocks-release.yaml @@ -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 From b8e29c0fba9a58bf6a5c37df77c7a6a31079c8d6 Mon Sep 17 00:00:00 2001 From: Magnus Keinicke Jensen <62600789+Wayfarer98@users.noreply.github.com> Date: Mon, 18 Dec 2023 09:47:28 +0100 Subject: [PATCH 4/5] docs(README): include treesitter dependency (#325) --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 072a5d5a..e7956548 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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) @@ -64,7 +66,8 @@ use { "nvim-neotest/neotest", requires = { "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim" + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter" } } ``` @@ -76,7 +79,8 @@ use { "nvim-neotest/neotest", dependencies = { "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim" + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter" } } ``` From a2f1cb4072bb29fcc067605fb712bbd83917513e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3n=C3=A1n=20Carrigan?= Date: Wed, 20 Dec 2023 18:34:20 +0000 Subject: [PATCH 5/5] feat(types): enums See #334 --- doc/neotest.txt | 25 ++++++++++++++++++------- lua/neotest/types/init.lua | 23 +++++++++++++++++++---- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/doc/neotest.txt b/doc/neotest.txt index 0d05dcce..485735e8 100644 --- a/doc/neotest.txt +++ b/doc/neotest.txt @@ -56,7 +56,7 @@ See the table of contents for the consumers Neotest strategies and consumers -See also~ +See also ~ |neotest.Config| Parameters~ @@ -189,6 +189,7 @@ Default values: enabled = true, symbol_queries = { elixir = , + 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 " } @@ -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()| @@ -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()* @@ -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* @@ -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()* @@ -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[])` diff --git a/lua/neotest/types/init.lua b/lua/neotest/types/init.lua index ea8a0463..9ffb1148 100644 --- a/lua/neotest/types/init.lua +++ b/lua/neotest/types/init.lua @@ -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[] @@ -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 -local M = {} - M.Tree = require("neotest.types.tree") M.FanoutAccum = require("neotest.types.fanout_accum")