From 0bc323850410df4c3c1dd8fabded9d2000189270 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Thu, 6 Apr 2023 18:13:57 +0200 Subject: test(Windows): normalize paths for test summary It previously gave a mix of forward and backslashes which was jarring. --- test/busted/outputHandlers/nvim.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/busted') diff --git a/test/busted/outputHandlers/nvim.lua b/test/busted/outputHandlers/nvim.lua index 2ce32c3b7a..e17536e0f8 100644 --- a/test/busted/outputHandlers/nvim.lua +++ b/test/busted/outputHandlers/nvim.lua @@ -204,7 +204,7 @@ return function(options) handler.fileStart = function(file) fileTestCount = 0 - io.write(fileStartString:format(file.name)) + io.write(fileStartString:format(vim.fs.normalize(file.name))) io.flush() return nil, true end @@ -213,7 +213,7 @@ return function(options) local elapsedTime_ms = getElapsedTime(file) local tests = (fileTestCount == 1 and 'test' or 'tests') fileCount = fileCount + 1 - io.write(fileEndString:format(fileTestCount, tests, file.name, elapsedTime_ms)) + io.write(fileEndString:format(fileTestCount, tests, vim.fs.normalize(file.name), elapsedTime_ms)) io.flush() return nil, true end -- cgit From 4f1d75daf8f4873d995c7e1eb93e56a2b22d2046 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 22 May 2023 10:47:40 +0200 Subject: ci: enable colors by default when testing Test colors were disabled in be7290d214673287218dcbd1a6730961cc067190 due to color codes interfering with the logs. I believe the solution to disable colors is too aggressive. Reading raw logs isn't common compared to reading CI results from the github UI. We should optimize the most common use case. It is also possible to interpret the colors codes in logs from neovim with a plugin that interprets ansi escape sequences. --- test/busted/outputHandlers/nvim.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/busted') diff --git a/test/busted/outputHandlers/nvim.lua b/test/busted/outputHandlers/nvim.lua index e17536e0f8..4bfa21fe49 100644 --- a/test/busted/outputHandlers/nvim.lua +++ b/test/busted/outputHandlers/nvim.lua @@ -1,9 +1,15 @@ local pretty = require 'pl.pretty' local global_helpers = require('test.helpers') --- Colors are disabled by default. #15610 local colors = setmetatable({}, {__index = function() return function(s) return s == nil and '' or tostring(s) end end}) + +local enable_colors = true if os.getenv "TEST_COLORS" then + local test_colors = os.getenv("TEST_COLORS"):lower() + local disable_colors = test_colors == 'false' or test_colors == '0' or test_colors == 'no' or test_colors == 'off' + enable_colors = not disable_colors +end +if enable_colors then colors = require 'term.colors' end -- cgit