Skip to content

Commit 3cde5e2

Browse files
committed
Merge branch 'main' into feat/unified_options_table
2 parents 1ff83ca + 1cb733b commit 3cde5e2

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

lua/neotest-vstest/health.lua

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ M.check = function()
44

55
vim.health.info("checking for dependencies...")
66

7-
local has_nio = pcall(require("nio"))
7+
local has_nio, nio = pcall(require, "nio")
88
if not has_nio then
99
vim.health.error("nio is not installed. Please install nio to use neotest-vstest.")
1010
else
1111
vim.health.ok("nio is installed.")
1212
end
1313

14-
local has_neotest = pcall(require("neotest"))
14+
local has_neotest = pcall(require, "neotest")
1515
if not has_neotest then
1616
vim.health.error("neotest is not installed. Please install neotest to use neotest-vstest.")
1717
else
@@ -21,16 +21,20 @@ M.check = function()
2121
vim.health.info("Checking neotest-vstest configuration...")
2222

2323
vim.health.info("Checking for vstest.console.dll...")
24-
local cli_wrapper = require("neotest-vstest.vstest.cli_wrapper")
25-
local vstest_path = cli_wrapper.get_vstest_path()
24+
if has_nio then
25+
nio.run(function()
26+
local cli_wrapper = require("neotest-vstest.vstest.cli_wrapper")
27+
local vstest_path = cli_wrapper.get_vstest_path()
2628

27-
-- make sure setup function parameters are ok
28-
if not vstest_path then
29-
vim.health.error(
30-
"Could not determine location of vstest.console.dll. Please set vim.g.neotest_vstest.sdk_path to the dotnet sdk path."
31-
)
32-
else
33-
vim.health.ok("Found vstest.console.dll at: " .. vstest_path)
29+
-- make sure setup function parameters are ok
30+
if not vstest_path then
31+
vim.health.error(
32+
"Could not determine location of vstest.console.dll. Please set vim.g.neotest_vstest.sdk_path to the dotnet sdk path."
33+
)
34+
else
35+
vim.health.ok("Found vstest.console.dll at: " .. vstest_path)
36+
end
37+
end)
3438
end
3539
end
3640
return M

lua/neotest-vstest/init.lua

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -584,16 +584,7 @@ local DotnetNeotestAdapter = create_adapter()
584584

585585
---@param opts neotest-vstest.Config
586586
local function apply_user_settings(_, opts)
587-
if opts then
588-
vim.g.neotest_vstest.sdk_path = opts.sdk_path or vim.g.neotest_vstest.sdk_path
589-
vim.g.neotest_vstest.build_opts = opts.build_opts or vim.g.neotest_vstest.build_opts
590-
vim.g.neotest_vstest.dap_settings = opts.dap_settings or vim.g.neotest_vstest.dap_settings
591-
vim.g.neotest_vstest.solution_selector = opts.solution_selector
592-
or vim.g.neotest_vstest.solution_selector
593-
vim.g.neotest_vstest.find_settings = opts.settings_selector
594-
or vim.g.neotest_vstest.find_settings
595-
vim.g.neotest_vstest.timeout_ms = opts.timeout_ms or vim.g.neotest_vstest.timeout_ms
596-
end
587+
vim.g.neotest_vstest = vim.tbl_deep_extend("force", vim.g.neotest_vstest or {}, opts or {})
597588
return create_adapter(opts)
598589
end
599590

lua/neotest-vstest/vstest/cli_wrapper.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ end
7676
---@return { execute: fun(content: string), stop: fun() }
7777
function M.create_test_runner(project)
7878
local test_discovery_script = get_script("run_tests.fsx")
79-
local testhost_dll = get_vstest_path()
79+
local testhost_dll = M.get_vstest_path()
8080

8181
logger.debug("neotest-vstest: found discovery script: " .. test_discovery_script)
8282
logger.debug("neotest-vstest: found testhost dll: " .. testhost_dll)

scripts/run_tests.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ module TestDiscovery =
239239
do
240240
Console.WriteLine($"spawned test process with pid: {pid}")
241241
use pidWriter = new StreamWriter(pidFile, append = false)
242-
pidWriter.WriteLine(pid)
242+
pidWriter.Write(pid)
243243

244244
while not (cts.Token.IsCancellationRequested || File.Exists(attachedFile)) do
245245
()

0 commit comments

Comments
 (0)