Resurrect #10241 with nits addressed
Not sure how much people want this. Would be useful for functional tests which cause bitcoind to print to stderr.
Tests which pass with non-empty stderr are reported as "passed with
warnings"
38 | @@ -40,17 +39,28 @@ 39 | CROSS = "x " 40 | CIRCLE = "o " 41 | 42 | +# Default colors to empty strings. 43 | +BOLD, BLUE, RED, GREY, MAGENTA = [("", "")] * 5
nit: alpha sort other than BOLD?
48 | - BLUE = ('\033[0m', '\033[0;34m') 49 | - RED = ('\033[0m', '\033[0;31m') 50 | GREY = ('\033[0m', '\033[1;30m') 51 | + RED = ('\033[0m', '\033[0;31m') 52 | + BLUE = ('\033[0m', '\033[0;34m') 53 | + MAGENTA = ('\033[0m', '\033[0;35m')
nit: alpha sort?
57 | 58 | +STATUS_PASSED = "Passed" 59 | +STATUS_PASSED_WITH_WARNINGS = "Passed with warnings" 60 | +STATUS_SKIPPED = "Skipped" 61 | +STATUS_FAILED = "Failed" 62 | +STATUSES = [STATUS_PASSED, STATUS_PASSED_WITH_WARNINGS, STATUS_SKIPPED, STATUS_FAILED]
This doesn't seem to be used anywhere else, maybe combine with line below?
IMO its cleaner how it is, shouldn't be combined
utACK, a few nits.
444 | - color = RED 445 | - glyph = CROSS 446 | - elif self.status == "Skipped": 447 | + if self.status == STATUS_PASSED_WITH_WARNINGS: 448 | + color = MAGENTA 449 | + glyph = TICK
Is TICK the best glyph to use for passed with warnings? Or something more neutral?
The code here looks like mostly output formatting changes, not actually dealing with the issue described by the title?
59 | +STATUS_PASSED_WITH_WARNINGS = "Passed with warnings" 60 | +STATUS_SKIPPED = "Skipped" 61 | +STATUS_FAILED = "Failed" 62 | +STATUSES = [STATUS_PASSED, STATUS_PASSED_WITH_WARNINGS, STATUS_SKIPPED, STATUS_FAILED] 63 | + 64 | +STATUS_MAX_LEN = max([len(st) for st in STATUSES])
Square brackets unneeded and probably should be dropped for slightly better readability & efficiency.
utACK d64ac3f4aab13a1a4e8d320b52e7a2b934e011b2. Note that #10882 is currently depending on this so it needs 0.15 milestone.
The code here looks like mostly output formatting changes, not actually dealing with the issue described by the title?
"Allow tests to pass" implies output formatting has to change at least somewhat to avoid giving impression that tests failed when they actually succeeded, and these changes are a pretty straightforward way of updating the output.
utACK d64ac3f4aab13a1a4e8d320b52e7a2b934e011b2
Reverted this in 60f9778 after discussion on IRC. Sorry @MarcoFalke but there seems no agreement on doing this change. It's unfortunate that #10882 requires this, but it seems like we'll have to look for an alternative solution there.