Skip to content

Commit

Permalink
fix(neotest): prevent running multiple tests, when running a single test
Browse files Browse the repository at this point in the history
  • Loading branch information
lpiepiora committed Dec 17, 2024
1 parent 25aab23 commit 3d3fd1e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
24 changes: 24 additions & 0 deletions lua/rustaceanvim/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ local lua_dependencies = {

---@class rustaceanvim.ExternalDependency
---@field name string Name of the dependency
---@field required_version_spec? string Version range spec. See `vim.version.range()`
---@field get_binaries fun():string[] Function that returns the binaries to check for
---@field is_installed? fun(bin: string):boolean Default: `vim.fn.executable(bin) == 1`
---@field optional fun():boolean Function that returns whether the dependency is optional
Expand Down Expand Up @@ -63,6 +64,13 @@ local check_installed = function(dep)
if error_msg then
return false, binary, error_msg
end
if dep.required_version_spec then
local version_range = vim.version.range(dep.required_version_spec)
if version_range and not version_range:has(binary_version) then
local msg = 'Unsuported version. Required ' .. dep.required_version_spec .. ', but found ' .. binary_version
return false, binary, msg
end
end
return true, binary, binary_version
end
return false, binary, 'Unable to determine version.'
Expand Down Expand Up @@ -267,6 +275,22 @@ function health.check()
Set in the config to override the 'cargo' command for debugging and testing.
]],
})
elseif config.tools.enable_nextest then
table.insert(external_dependencies, {
name = 'cargo-nextest',
required_version_spec = '>=0.9.81',
get_binaries = function()
return { 'cargo-nextest' }
end,
optional = function()
return false
end,
url = '[cargo-nextest](https://nexte.st)',
info = [[
Next generation test runner for Rust projects.
Optional dependency, required if the 'tools.enable_nextest' option is set.
]],
})
end

if adapter ~= false then
Expand Down
1 change: 0 additions & 1 deletion lua/rustaceanvim/overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ function M.try_nextest_transform(args)
table.remove(args, #args)
end
local nextest_unsupported_flags = {
'--exact',
'--show-output',
}
local indexes_to_remove_reverse_order = {}
Expand Down

0 comments on commit 3d3fd1e

Please sign in to comment.