diff --git a/lua/neotest/client/runner.lua b/lua/neotest/client/runner.lua index 6ac5e03c..ba5d7057 100644 --- a/lua/neotest/client/runner.lua +++ b/lua/neotest/client/runner.lua @@ -85,6 +85,11 @@ function TestRunner:_run_tree(tree, args, adapter_id, adapter, results_callback) end local async_runners = {} for _, spec in ipairs(specs) do + if not (type(spec.strategy) == "function" or type(spec.strategy) == "table" or spec.strategy == nil) then + self:_run_broken_down_tree(tree, args, adapter_id, adapter, results_callback) + return + end + table.insert(async_runners, function() self:_run_spec(spec, tree, args, adapter_id, adapter, results_callback) end) diff --git a/lua/neotest/client/strategies/init.lua b/lua/neotest/client/strategies/init.lua index 667b4f76..278d490c 100644 --- a/lua/neotest/client/strategies/init.lua +++ b/lua/neotest/client/strategies/init.lua @@ -39,10 +39,7 @@ function ProcessTracker:run(pos_id, spec, args, stream_processor, context) self._process_semaphore.with(function() instance = strategy(spec, context) if not instance then - lib.notify("Adapter doesn't support chosen strategy.", vim.log.levels.ERROR) - local output_path = nio.fn.tempname() - assert(io.open(output_path, "w")):close() - return { code = 1, output = output_path } + return end self._instances[pos_id] = instance if stream_processor then @@ -53,6 +50,10 @@ function ProcessTracker:run(pos_id, spec, args, stream_processor, context) end code = instance.result() end) + if not instance then + error("Adapter doesn't provide a correct strategy") + end + logger.info("Process for position", pos_id, "exited with code", code) local output = instance.output() logger.debug("Output of process ", output)