From 5e6cef4c0d7e600d14dbb352d6257a6b389bccbe Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 15 Mar 2019 11:54:46 +0100 Subject: [PATCH 1/2] Fix set of run environs when using regex selection - Define the set of run environments correctly when `-p` option is used with regular expressions --- reframe/frontend/cli.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 3932ab1ed2..217a5f6922 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -1,6 +1,7 @@ import inspect import json import os +import re import socket import sys import traceback @@ -452,6 +453,12 @@ def main(): checks_matched = [c for c in checks_matched] + # Determine the programming environments to run with + run_environs = {e.name + for env_patt in options.prgenv + for p in rt.system.partitions + for e in p.environs if re.match(env_patt, e.name)} + # Act on checks # Unload regression's module and load user-specified modules @@ -496,7 +503,7 @@ def main(): exec_policy.skip_environ_check = options.skip_prgenv_check exec_policy.skip_sanity_check = options.skip_sanity_check exec_policy.skip_performance_check = options.skip_performance_check - exec_policy.only_environs = options.prgenv + exec_policy.only_environs = run_environs exec_policy.keep_stage_files = options.keep_stage_files try: errmsg = "invalid option for --flex-alloc-tasks: '{0}'" From 3ed3d71b57dd4ab6c2b7d1e290c0525fb64ce03f Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Fri, 15 Mar 2019 13:58:43 +0100 Subject: [PATCH 2/2] Fix unit test failure on Kesch --- unittests/test_cli.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unittests/test_cli.py b/unittests/test_cli.py index cb644160a5..416e626ed9 100644 --- a/unittests/test_cli.py +++ b/unittests/test_cli.py @@ -148,12 +148,16 @@ def test_check_submit_success(self): self.local = False self.system = partition.fullname - # pick up the programming environment of the partition - self.environs = [partition.environs[0].name] + # Pick up the programming environment of the partition + # Prepend ^ and append $ so as to much exactly the given name + self.environs = ['^' + partition.environs[0].name + '$'] returncode, stdout, _ = self._run_reframe() self.assertNotIn('FAILED', stdout) self.assertIn('PASSED', stdout) + + # Assert that we have run only one test case + self.assertIn('Ran 1 test case(s)', stdout) self.assertEqual(0, returncode) def test_check_failure(self):