restraint uses ANSI color coding in the logs even if the user/consumer expects plain text. This makes logs hard to read and parse. :: [[0;32m PASS [0m] :: Creating tmp directory (Expected 0, got 0) :: [[0;32m PASS [0m] :: Command 'chmod a+rx /tmp/tmp.sonUBNhf6Z' (Expected 0, got 0) :: [[0;32m PASS [0m] :: Command 'skfjhxshg=/tmp/tmp.sonUBNhf6Z' (Expected 0, got 0)
I think the coloured output here is actually coming from beakerlib, right? Beakerlib thinks it's writing to a terminal because restraint runs tests attached to a pty, even though it's really just saving the output to a log file.
Maybe we could set a env variable that beakerlib could use to disable the ansi color when set. #@staticmethod def printLog(message, prefix="LOG"): color = uncolor = "" if sys.stdout.isatty() and prefix in ("PASS", "FAIL", "INFO", "WARNING"): color = termColors[prefix] uncolor = "\033[0m" would need to be updated..
(In reply to Dan Callaghan from comment #2) > I think the coloured output here is actually coming from beakerlib, right? right. reassigning again...
This could be also done together with bz483014.
@azelinka: Is this bug only restraint related ? (Do you think this feature is needed at beakerlib even if this will be resolved in restraint ?)
this was filed against restraint by mistake, it's beakerlib bug that should be fixed in beakerlib. AFAIK.
In my opinion the root of problem is in terminal checking, because there isn't check for env. variable TERM for compatible terminal (xterm* or vt100).
coloring is now limitted to specific terminals