diff --git a/nixos/lib/test-driver/test_driver/driver.py b/nixos/lib/test-driver/test_driver/driver.py index 0e5f013193fe..e32f6810ca87 100644 --- a/nixos/lib/test-driver/test_driver/driver.py +++ b/nixos/lib/test-driver/test_driver/driver.py @@ -86,7 +86,7 @@ class Driver: def subtest(self, name: str) -> Iterator[None]: """Group logs under a given test name""" - with rootlog.nested(name): + with rootlog.nested("subtest: " + name): try: yield return True diff --git a/nixos/lib/test-driver/test_driver/logger.py b/nixos/lib/test-driver/test_driver/logger.py index 5b3091a5129c..59ed29547231 100644 --- a/nixos/lib/test-driver/test_driver/logger.py +++ b/nixos/lib/test-driver/test_driver/logger.py @@ -1,4 +1,4 @@ -from colorama import Style +from colorama import Style, Fore from contextlib import contextmanager from typing import Any, Dict, Iterator from queue import Queue, Empty @@ -81,7 +81,11 @@ class Logger: @contextmanager def nested(self, message: str, attributes: Dict[str, str] = {}) -> Iterator[None]: - self._eprint(self.maybe_prefix(message, attributes)) + self._eprint( + self.maybe_prefix( + Style.BRIGHT + Fore.GREEN + message + Style.RESET_ALL, attributes + ) + ) self.xml.startElement("nest", attrs={}) self.xml.startElement("head", attributes)