From 13748512f6d6dfb5895c2233d2e07480e00eb753 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 9 Sep 2021 09:18:43 -0700 Subject: [PATCH] test(busted): disable colors in test-runner output #15610 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem ------- Because test/busted/outputHandlers/nvim.lua doesn't know if it's running in a terminal (no "isatty" equivalent), it outputs color codes in CI logs and local tooling that runs the tests in a pipe: [1m[ SKIPPED ]  This is just noise, hard for humans to read. Solution -------- Disable the color codes. If we later find a clever way to detect a terminal in nvim.lua, we might consider re-enabling colors, but that would still affect the CI build logs... --- test/busted/outputHandlers/nvim.lua | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/busted/outputHandlers/nvim.lua b/test/busted/outputHandlers/nvim.lua index 5456e9ca98..17154f1aa2 100644 --- a/test/busted/outputHandlers/nvim.lua +++ b/test/busted/outputHandlers/nvim.lua @@ -1,15 +1,9 @@ local pretty = require 'pl.pretty' local global_helpers = require('test.helpers') -local colors - -local isWindows = package.config:sub(1,1) == '\\' - -if isWindows then - colors = setmetatable({}, {__index = function() return function(s) return s end end}) -else - colors = require 'term.colors' -end +-- Colors are disabled. #15610 +-- To enable: `local colors = require 'term.colors'` +local colors = setmetatable({}, {__index = function() return function(s) return s end end}) return function(options) local busted = require 'busted'