From e6428543fdfe02354eec5332b6ff420a112049aa Mon Sep 17 00:00:00 2001 From: Eirini Koutsaniti Date: Tue, 5 May 2020 09:27:13 +0200 Subject: [PATCH 1/3] Fix unittest deprecation warnings --- unittests/resources/checks/frontend_checks.py | 2 +- unittests/resources/checks_unlisted/selfkill.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/unittests/resources/checks/frontend_checks.py b/unittests/resources/checks/frontend_checks.py index 6b7a30c013..17331036f3 100644 --- a/unittests/resources/checks/frontend_checks.py +++ b/unittests/resources/checks/frontend_checks.py @@ -85,7 +85,7 @@ def __init__(self): @rfm.simple_test -class CustomPerformanceFailureCheck(BaseFrontendCheck): +class CustomPerformanceFailureCheck(BaseFrontendCheck, special=True): '''Simulate a performance check that ignores completely logging''' def __init__(self): diff --git a/unittests/resources/checks_unlisted/selfkill.py b/unittests/resources/checks_unlisted/selfkill.py index 552df6831a..64d2ac304b 100644 --- a/unittests/resources/checks_unlisted/selfkill.py +++ b/unittests/resources/checks_unlisted/selfkill.py @@ -25,7 +25,7 @@ def __init__(self): self.tags = {type(self).__name__} self.maintainers = ['TM'] - def run(self): - super().run() + @rfm.run_before('run') + def self_kill(self): time.sleep(0.5) os.kill(os.getpid(), signal.SIGTERM) From 2eee7efad91a8246f0a4017eb93a4cc9ae9da2ff Mon Sep 17 00:00:00 2001 From: Eirini Koutsaniti Date: Tue, 5 May 2020 09:48:33 +0200 Subject: [PATCH 2/3] Treat ReframeDeprecationWarning as error in jenkins --- ci-scripts/ci-runner.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-scripts/ci-runner.bash b/ci-scripts/ci-runner.bash index 90fb0ca7b8..3e4c9c6f4c 100644 --- a/ci-scripts/ci-runner.bash +++ b/ci-scripts/ci-runner.bash @@ -163,8 +163,8 @@ if [ $CI_GENERIC -eq 1 ]; then echo "========================================" echo "Running unit tests with generic settings" echo "========================================" - checked_exec ./test_reframe.py - checked_exec ! ./bin/reframe.py --system=generic -l 2>&1 | \ + checked_exec ./test_reframe.py -W=error::reframe.core.exceptions.ReframeDeprecationWarning + checked_exec ! ./bin/reframe.py -W=error::reframe.core.exceptions.ReframeDeprecationWarning --system=generic -l 2>&1 | \ grep -- '--- Logging error ---' elif [ $CI_TUTORIAL -eq 1 ]; then # Run tutorial checks @@ -190,7 +190,7 @@ else echo "Running unit tests" echo "==================" - checked_exec ./test_reframe.py --rfm-user-config=config/cscs-ci.py + checked_exec ./test_reframe.py -W=error::reframe.core.exceptions.ReframeDeprecationWarning --rfm-user-config=config/cscs-ci.py if [[ $(hostname) =~ dom ]]; then PATH_save=$PATH @@ -199,7 +199,7 @@ else echo "Running unit tests with ${backend}" echo "==================================" export PATH=/apps/dom/UES/karakasv/slurm-wrappers/bin:$PATH - checked_exec ./test_reframe.py --rfm-user-config=config/cscs-${backend}.py + checked_exec ./test_reframe.py -W=error::reframe.core.exceptions.ReframeDeprecationWarning --rfm-user-config=config/cscs-${backend}.py done export PATH=$PATH_save fi From bbe2f76f672367e20463e1221782ccf1f88be582 Mon Sep 17 00:00:00 2001 From: Eirini Koutsaniti Date: Tue, 5 May 2020 13:34:28 +0200 Subject: [PATCH 3/3] Mark SelfKillCheck as a special test --- unittests/resources/checks_unlisted/selfkill.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/unittests/resources/checks_unlisted/selfkill.py b/unittests/resources/checks_unlisted/selfkill.py index 64d2ac304b..5995ec6f17 100644 --- a/unittests/resources/checks_unlisted/selfkill.py +++ b/unittests/resources/checks_unlisted/selfkill.py @@ -15,7 +15,7 @@ @rfm.simple_test -class SelfKillCheck(rfm.RunOnlyRegressionTest): +class SelfKillCheck(rfm.RunOnlyRegressionTest, special=True): def __init__(self): self.local = True self.valid_systems = ['*'] @@ -25,7 +25,7 @@ def __init__(self): self.tags = {type(self).__name__} self.maintainers = ['TM'] - @rfm.run_before('run') - def self_kill(self): + def run(self): + super().run() time.sleep(0.5) os.kill(os.getpid(), signal.SIGTERM)