Print nodes' errors and warnings
(tmp_dir, colors)
| 100 | |
| 101 | |
| 102 | def print_node_warnings(tmp_dir, colors): |
| 103 | """Print nodes' errors and warnings""" |
| 104 | |
| 105 | warnings = [] |
| 106 | for stream in ['stdout', 'stderr']: |
| 107 | for i in itertools.count(): |
| 108 | folder = "{}/node{}/{}".format(tmp_dir, i, stream) |
| 109 | if not os.path.isdir(folder): |
| 110 | break |
| 111 | for (_, _, fns) in os.walk(folder): |
| 112 | for fn in fns: |
| 113 | warning = pathlib.Path('{}/{}'.format(folder, fn)).read_text().strip() |
| 114 | if warning: |
| 115 | warnings.append(("node{} {}".format(i, stream), warning)) |
| 116 | |
| 117 | print() |
| 118 | for w in warnings: |
| 119 | print("{} {} {} {}".format(colors[w[0].split()[0]], w[0], w[1], colors["reset"])) |
| 120 | |
| 121 | |
| 122 | def find_latest_test_dir(): |