From b580e7bbdb73fc8929cd66c297bd4cf6215f3364 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 29 Oct 2021 16:36:23 +0200 Subject: [PATCH] Introduce properly the RFM_TRAP_JOB_ERRORS env. variable --- docs/config_reference.rst | 2 ++ docs/manpage.rst | 4 +++- reframe/frontend/cli.py | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/config_reference.rst b/docs/config_reference.rst index 482e4ec6d2..46da7eca51 100644 --- a/docs/config_reference.rst +++ b/docs/config_reference.rst @@ -1321,6 +1321,8 @@ General Configuration Trap command errors in the generated job scripts and let them exit immediately. + .. versionadded:: 3.2 + .. js:attribute:: .general[].keep_stage_files diff --git a/docs/manpage.rst b/docs/manpage.rst index fc480c95f5..66b3e07a82 100644 --- a/docs/manpage.rst +++ b/docs/manpage.rst @@ -1113,7 +1113,7 @@ Here is an alphabetical list of the environment variables recognized by ReFrame: .. envvar:: RFM_TRAP_JOB_ERRORS - Ignore job exit code + Trap job errors in submitted scripts and fail tests automatically. .. table:: :align: left @@ -1122,6 +1122,8 @@ Here is an alphabetical list of the environment variables recognized by ReFrame: Associated configuration parameter :js:attr:`trap_job_errors` general configuration parameter ================================== ================== + .. versionadded:: 3.9.0 + .. envvar:: RFM_UNLOAD_MODULES diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 51ffa05514..9cf350fd61 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -530,6 +530,13 @@ def main(): configvar='logging/handlers_perflog/syslog_address', help='Syslog server address' ) + argparser.add_argument( + dest='trap_job_errors', + envvar='RFM_TRAP_JOB_ERRORS', + configvar='general/trap_job_errors', + action='store_true', + help='Trap job errors in job scripts and fail tests automatically' + ) argparser.add_argument( dest='use_login_shell', envvar='RFM_USE_LOGIN_SHELL',