-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update test_harness.lua #476
Conversation
It is getting further than before, but I'm still getting stuck and not able to run tests. I've been snooping around but have not been able to find any other reasons that might be blocking on windows. My output that I'm getting with two test files available looks like this nvim --headless -c "PlenaryBustedDirectory ."
Starting...Scheduling: tests\bit-flip_spec.lua
Scheduling: tests\comma_count_spec.lua It freezes here for about 20 seconds then exits without any more output. I've also tried using This is the normalize testing I've done function harness._find_files_to_run(directory)
-- Default use the find command
local find_command = "find"
local find_args = { "-type", "f", "-name", "*_spec.lua" }
-- On windows use powershell Get-ChildItem instead
if vim.fn.has('win32') == 1 or vim.fn.has('win64') == 1 then
find_command = "powershell"
find_args = { '-Command', [[Get-ChildItem -Recurse -n -Filter "*_spec.lua"]] }
end
local finder = Job:new {
command = find_command,
args = find_args,
cwd = directory,
}
local files = finder:sync()
for k,v in pairs(files) do
files[k] = './' .. vim.fs.normalize(v)
end
local output = vim.tbl_map(Path.new, files)
return output
end Any ideas of additional things to try here? |
Good news, I've found the last spot causing issues running the test harness on windows. I tried using the sequential testing and that gave me more meaningful errors than running parallel tests. Luckily after some digging I found the location. local args = {
"--headless",
"-c",
string.format('lua require("plenary.busted").run("%s")', p:absolute()),
} Just needed this small gsub change local args = {
"--headless",
"-c",
string.format('lua require("plenary.busted").run("%s")', p:absolute():gsub("\\","\\\\")),
} I looked into making a change at the source of the I'm also a slight bit worried that this could mess up other paths that have a backslash for something other than Windows path separators. I can confirm now that it does fully work on Windows. I've also tested again on Linux and proved I didn't break anything. To summarize my two commits:
|
Add support for test harness on windows. Using the find command does not work on windows, these changes should fix the problem.
thats awesome, i try to figure out why linux is borked and then merge. thanks you very much :) |
i hope i didn't broke windows in the process ^^ |
Awesome, yay! Yep everything is running fine for me still. |
Add support for test harness on windows. Using the find command does not work on windows, these changes should fix the problem.