nixos/test-driver: separate the subtest log call
We do not use the generic "nested" function but introduce a separate subtest log call. This will later allow us to track subtests and account logs to specific subtests.
This commit is contained in:
@@ -99,7 +99,7 @@ class Driver:
|
|||||||
|
|
||||||
def subtest(self, name: str) -> Iterator[None]:
|
def subtest(self, name: str) -> Iterator[None]:
|
||||||
"""Group logs under a given test name"""
|
"""Group logs under a given test name"""
|
||||||
with rootlog.nested("subtest: " + name):
|
with rootlog.subtest(name):
|
||||||
try:
|
try:
|
||||||
yield
|
yield
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ class Logger:
|
|||||||
except Empty:
|
except Empty:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@contextmanager
|
||||||
|
def subtest(self, name: str, attributes: Dict[str, str] = {}) -> Iterator[None]:
|
||||||
|
with self.nested("subtest: " + name, attributes):
|
||||||
|
yield
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def nested(self, message: str, attributes: Dict[str, str] = {}) -> Iterator[None]:
|
def nested(self, message: str, attributes: Dict[str, str] = {}) -> Iterator[None]:
|
||||||
self._eprint(
|
self._eprint(
|
||||||
|
|||||||
Reference in New Issue
Block a user