Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions reframe/core/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ def _create_file_handler(site_config, config_prefix):


def _create_filelog_handler(site_config, config_prefix):
basedir = os.path.abspath(site_config.get(f'{config_prefix}/basedir'))
prefix = site_config.get(f'{config_prefix}/prefix')
basedir = os.path.abspath(
osext.expandvars(site_config.get(f'{config_prefix}/basedir'))
)
prefix = osext.expandvars(site_config.get(f'{config_prefix}/prefix'))
filename_patt = os.path.join(basedir, prefix)
append = site_config.get(f'{config_prefix}/append')
return MultiFileHandler(filename_patt, mode='a+' if append else 'w+')
Expand Down
16 changes: 15 additions & 1 deletion unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,22 @@ def test_performance_check_failure(run_reframe, tmp_path, perflogdir):
'default' / 'PerformanceFailureCheck.log')


def test_performance_report(run_reframe):
def test_perflogdir_from_env(run_reframe, tmp_path, monkeypatch):
monkeypatch.setenv('FOODIR', str(tmp_path / 'perflogs'))
returncode, stdout, stderr = run_reframe(
checkpath=['unittests/resources/checks/frontend_checks.py'],
more_options=['-t', 'PerformanceFailureCheck'],
perflogdir='$FOODIR'
)
assert returncode == 1
assert 'Traceback' not in stdout
assert 'Traceback' not in stderr
assert os.path.exists(tmp_path / 'perflogs' / 'generic' /
'default' / 'PerformanceFailureCheck.log')


def test_performance_report(run_reframe):
returncode, stdout, _ = run_reframe(
checkpath=['unittests/resources/checks/frontend_checks.py'],
more_options=['-t', 'PerformanceFailureCheck', '--performance-report']
)
Expand Down