Skip to content

Commit cb5fb5b

Browse files
committed
Improve logging of test case generation
1 parent 6a33b94 commit cb5fb5b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

reframe/frontend/executors/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
SkipTestError,
2929
StatisticsError,
3030
TaskExit)
31+
from reframe.core.logging import getlogger
3132
from reframe.core.schedulers.local import LocalJobScheduler
3233
from reframe.frontend.printer import PrettyPrinter
3334

@@ -174,11 +175,17 @@ def generate_testcases(checks, prepare=False):
174175

175176
cases = []
176177
for c in checks:
178+
getlogger().debug(
179+
f'Resolving systems/environments for {c.display_name!r} with:'
180+
)
181+
getlogger().debug(f' > valid_systems: {c.valid_systems}')
182+
getlogger().debug(f' > valid_prog_environs: {c.valid_prog_environs}')
177183
valid_comb = runtime.valid_sysenv_comb(c.valid_systems,
178184
c.valid_prog_environs)
179185
for part, environs in valid_comb.items():
180186
for env in environs:
181187
case = TestCase(c, part, env)
188+
getlogger().debug(f' Generated test case: {case}')
182189
if prepare:
183190
case.prepare()
184191

@@ -475,7 +482,7 @@ def finalize(self):
475482
with open(jsonfile, 'w') as fp:
476483
jsonext.dump(self.check, fp, indent=2)
477484
except OSError as e:
478-
logging.getlogger().warning(
485+
getlogger().warning(
479486
f'could not dump test case {self.testcase}: {e}'
480487
)
481488

@@ -485,7 +492,7 @@ def finalize(self):
485492
self._perflogger.log_performance(logging.INFO, self,
486493
multiline=self._perflog_compat)
487494
except LoggingError as e:
488-
logging.getlogger().warning(
495+
getlogger().warning(
489496
f'could not log performance data for {self.testcase}: {e}'
490497
)
491498

@@ -501,7 +508,7 @@ def fail(self, exc_info=None, callback='on_task_failure'):
501508
self._perflogger.log_performance(logging.INFO, self,
502509
multiline=self._perflog_compat)
503510
except LoggingError as e:
504-
logging.getlogger().warning(
511+
getlogger().warning(
505512
f'could not log performance data for {self.testcase}: {e}'
506513
)
507514

@@ -515,7 +522,7 @@ def abort(self, cause=None):
515522
if self.failed or self._aborted:
516523
return
517524

518-
logging.getlogger().debug2(f'Aborting test case: {self.testcase!r}')
525+
getlogger().debug2(f'Aborting test case: {self.testcase!r}')
519526
exc = AbortTaskError()
520527
exc.__cause__ = cause
521528
self._aborted = True

0 commit comments

Comments
 (0)