reframe-hpc / reframe

@@ -252,14 +252,10 @@
Loading
252 252
            printer.info(f"  * Maintainers: {r['maintainers']}")
253 253
            printer.info(f"  * Failing phase: {r['fail_phase']}")
254 254
            if rerun_info and not r['fixture']:
255 -
                if rt.runtime().get_option('general/0/compact_test_names'):
256 -
                    cls = r['display_name'].split(' ')[0]
257 -
                    variant = r['unique_name'].replace(cls, '')
258 -
                    variant = variant.replace('_', '@')
259 -
                    nameoptarg = cls + variant
260 -
                else:
261 -
                    nameoptarg = r['unique_name']
262 -
255 +
                cls = r['display_name'].split(' ')[0]
256 +
                variant = r['unique_name'].replace(cls, '')
257 +
                variant = variant.replace('_', '@')
258 +
                nameoptarg = cls + variant
263 259
                printer.info(f"  * Rerun with '-n {nameoptarg}"
264 260
                             f" -p {r['environment']} --system "
265 261
                             f"{r['system']} -r'")

@@ -10,7 +10,6 @@
Loading
10 10
__all__ = ['simple_test']
11 11
12 12
13 -
import collections
14 13
import inspect
15 14
import sys
16 15
import traceback
@@ -42,7 +41,6 @@
Loading
42 41
43 42
    def __init__(self):
44 43
        self._tests = dict()
45 -
        self._skip_tests = set()
46 44
47 45
    @classmethod
48 46
    def create(cls, test, *args, **kwargs):
@@ -54,11 +52,6 @@
Loading
54 52
        self._tests.setdefault(test, [])
55 53
        self._tests[test].append((args, kwargs))
56 54
57 -
    # FIXME: To drop with the required_version decorator
58 -
    def skip(self, test):
59 -
        '''Add a test to the skip set.'''
60 -
        self._skip_tests.add(test)
61 -
62 55
    @time_function
63 56
    def instantiate_all(self, reset_sysenv=0):
64 57
        '''Instantiate all the registered tests.
@@ -75,9 +68,6 @@
Loading
75 68
76 69
        leaf_tests = []
77 70
        for test, variants in self._tests.items():
78 -
            if test in self._skip_tests:
79 -
                continue
80 -
81 71
            for args, kwargs in variants:
82 72
                try:
83 73
                    kwargs['reset_sysenv'] = reset_sysenv
@@ -138,54 +128,6 @@
Loading
138 128
        mod._rfm_test_registry.add(cls, *args, **kwargs)
139 129
140 130
141 -
def _register_parameterized_test(cls, args=None):
142 -
    '''Register the test.
143 -
144 -
    Register the test with _rfm_use_params=True. This additional argument flags
145 -
    this case to consume the parameter space. Otherwise, the regression test
146 -
    parameters would simply be initialized to None.
147 -
    '''
148 -
    def _instantiate(cls, args):
149 -
        if isinstance(args, collections.abc.Sequence):
150 -
            return cls(*args)
151 -
        elif isinstance(args, collections.abc.Mapping):
152 -
            return cls(**args)
153 -
        elif args is None:
154 -
            return cls()
155 -
156 -
    def _instantiate_all():
157 -
        ret = []
158 -
        for cls, args in mod.__rfm_test_registry:
159 -
            try:
160 -
                if cls in mod.__rfm_skip_tests:
161 -
                    continue
162 -
            except AttributeError:
163 -
                mod.__rfm_skip_tests = set()
164 -
165 -
            try:
166 -
                ret.append(_instantiate(cls, args))
167 -
            except SkipTestError as e:
168 -
                getlogger().warning(f'skipping test {cls.__qualname__!r}: {e}')
169 -
            except Exception:
170 -
                exc_info = sys.exc_info()
171 -
                getlogger().warning(
172 -
                    f"skipping test {cls.__qualname__!r}: {what(*exc_info)} "
173 -
                    f"(rerun with '-v' for more information)"
174 -
                )
175 -
                getlogger().verbose(traceback.format_exc())
176 -
177 -
        return ret
178 -
179 -
    mod = inspect.getmodule(cls)
180 -
    if not hasattr(mod, '_rfm_gettests'):
181 -
        mod._rfm_gettests = _instantiate_all
182 -
183 -
    try:
184 -
        mod.__rfm_test_registry.append((cls, args))
185 -
    except AttributeError:
186 -
        mod.__rfm_test_registry = [(cls, args)]
187 -
188 -
189 131
def _validate_test(cls):
190 132
    if not issubclass(cls, RegressionTest):
191 133
        raise ReframeSyntaxError('the decorated class must be a '

@@ -20,7 +20,6 @@
Loading
20 20
import reframe.utility as utils
21 21
22 22
from reframe.core.exceptions import ReframeSyntaxError
23 -
from reframe.core.runtime import runtime
24 23
25 24
26 25
class RegressionTestMeta(type):
@@ -799,20 +798,9 @@
Loading
799 798
        if variant_num is None:
800 799
            return name
801 800
802 -
        if runtime().get_option('general/0/compact_test_names'):
803 -
            if cls.num_variants > 1:
804 -
                width = utils.count_digits(cls.num_variants)
805 -
                name += f'_{variant_num:0{width}}'
806 -
        else:
807 -
            pid, fid = cls._map_variant_num(variant_num)
808 -
809 -
            # Append the parameters to the name
810 -
            if cls.param_space.params:
811 -
                name += '_' + '_'.join(utils.toalphanum(str(v))
812 -
                                       for v in cls.param_space[pid].values())
813 -
814 -
            if len(cls.fixture_space) > 1:
815 -
                name += f'_{fid}'
801 +
        if cls.num_variants > 1:
802 +
            width = utils.count_digits(cls.num_variants)
803 +
            name += f'_{variant_num:0{width}}'
816 804
817 805
        return name
818 806

@@ -914,8 +914,7 @@
Loading
914 914
        # Prepare initialization of test defaults (variables and parameters are
915 915
        # injected after __new__ has returned, so we schedule this function
916 916
        # call as a pre-init hook).
917 -
        obj.__deferred_rfm_init = obj.__rfm_init__(*args,
918 -
                                                   prefix=prefix, **kwargs)
917 +
        obj.__deferred_rfm_init = obj.__rfm_init__(prefix)
919 918
920 919
        # Build pipeline hook registry and add the pre-init hook
921 920
        cls._rfm_pipeline_hooks = cls._process_hook_registry()
@@ -959,17 +958,10 @@
Loading
959 958
            )
960 959
961 960
    @deferrable
962 -
    def __rfm_init__(self, *args, prefix=None, **kwargs):
961 +
    def __rfm_init__(self, prefix=None):
963 962
        if not self.is_fixture() and not hasattr(self, '_rfm_unique_name'):
964 963
            self._rfm_unique_name = type(self).variant_name(self.variant_num)
965 964
966 -
            # Add the parameters from the parameterized_test decorator.
967 -
            if args or kwargs:
968 -
                arg_names = map(lambda x: util.toalphanum(str(x)),
969 -
                                itertools.chain(args, kwargs.values()))
970 -
                self._rfm_unique_name += '_' + '_'.join(arg_names)
971 -
                self._rfm_old_style_params = True
972 -
973 965
        # Pass if descr is a required variable.
974 966
        if not hasattr(self, 'descr'):
975 967
            self.descr = self.display_name
@@ -1092,6 +1084,7 @@
Loading
1092 1084
        '''
1093 1085
        return self._rfm_unique_name
1094 1086
1087 +
    @loggable
1095 1088
    @property
1096 1089
    def name(self):
1097 1090
        '''The name of the test.
@@ -1136,9 +1129,6 @@
Loading
1136 1129
1137 1130
            return name
1138 1131
1139 -
        if hasattr(self, '_rfm_old_style_params'):
1140 -
            return self.unique_name
1141 -
1142 1132
        if hasattr(self, '_rfm_display_name'):
1143 1133
            return self._rfm_display_name
1144 1134

@@ -580,10 +580,6 @@
Loading
580 580
            self.extra[f'check_{extra_name}'] = val
581 581
582 582
        # Add special extras
583 -
584 -
        # FIXME: As soon as `name` becomes a read-only property in 4.0, the
585 -
        # following assignment will not be needed.
586 -
        self.extra['check_name'] = self.extra['check_unique_name']
587 583
        self.extra['check_info'] = self.check.info()
588 584
        self.extra['check_job_completion_time'] = _format_time_rfc3339(
589 585
            time.localtime(self.extra['check_job_completion_time_unix']),

@@ -595,13 +595,6 @@
Loading
595 595
        action='store_true',
596 596
        help='Graylog server address'
597 597
    )
598 -
    argparser.add_argument(
599 -
        dest='compact_test_names',
600 -
        envvar='RFM_COMPACT_TEST_NAMES',
601 -
        configvar='general/compact_test_names',
602 -
        action='store_true',
603 -
        help='Use a compact test naming scheme'
604 -
    )
605 598
    argparser.add_argument(
606 599
        dest='dump_pipeline_progress',
607 600
        envvar='RFM_DUMP_PIPELINE_PROGRESS',

@@ -111,11 +111,6 @@
Loading
111 111
            p.fullname: {e.name for e in p.environs} for p in sys_part
112 112
        }
113 113
114 -
        # Compact naming switch
115 -
        self._hash = runtime.runtime().get_option(
116 -
            'general/0/compact_test_names'
117 -
        )
118 -
119 114
        # Store the system name for name-mangling purposes
120 115
        self._sys_name = runtime.runtime().system.name
121 116
@@ -177,10 +172,7 @@
Loading
177 172
                (f'%{k}={utils.toalphanum(str(v))}' for k, v
178 173
                 in sorted(variables.items()))
179 174
            )
180 -
            if self._hash:
181 -
                vname = '_' + sha256(vname.encode('utf-8')).hexdigest()[:8]
182 -
183 -
            fname += vname
175 +
            fname += '_' + sha256(vname.encode('utf-8')).hexdigest()[:8]
184 176
185 177
        # Select only the valid partitions
186 178
        try:

@@ -166,20 +166,8 @@
Loading
166 166
        This method tries to load the test registry from a given module and
167 167
        instantiates all the tests in the registry. The instantiated checks
168 168
        are validated before return.
169 -
170 -
        For legacy reasons, a module might have the additional legacy registry
171 -
        `_rfm_gettests`, which is a method that instantiates all the tests
172 -
        registered with the deprecated `parameterized_test` decorator.
173 169
        '''
174 -
        from reframe.core.pipeline import RegressionTest
175 -
176 -
        # FIXME: Remove the legacy_registry after dropping parameterized_test
177 170
        registry = getattr(module, '_rfm_test_registry', None)
178 -
        legacy_registry = getattr(module, '_rfm_gettests', None)
179 -
        if not any((registry, legacy_registry)):
180 -
            getlogger().debug('No tests registered')
181 -
            return []
182 -
183 171
        self._set_defaults(registry)
184 172
        reset_sysenv = self._skip_prgenv_check << 1 | self._skip_system_check
185 173
        if registry:
@@ -187,32 +175,9 @@
Loading
187 175
        else:
188 176
            candidate_tests = []
189 177
190 -
        legacy_tests = legacy_registry() if legacy_registry else []
191 -
        if self._external_vars and legacy_tests:
192 -
            getlogger().warning(
193 -
                "variables of tests using the deprecated "
194 -
                "'@parameterized_test' decorator cannot be set externally; "
195 -
                "please use the 'parameter' builtin in your tests"
196 -
            )
197 -
198 -
        # Reset valid_systems and valid_prog_environs in all legacy tests
199 -
        if reset_sysenv:
200 -
            for t in legacy_tests:
201 -
                if self._skip_system_check:
202 -
                    t.valid_systems = ['*']
203 -
204 -
                if self._skip_prgenv_check:
205 -
                    t.valid_prog_environs = ['*']
206 -
207 -
        # Merge tests
208 -
        candidate_tests += legacy_tests
209 -
210 178
        # Post-instantiation validation of the candidate tests
211 179
        final_tests = []
212 180
        for c in candidate_tests:
213 -
            if not isinstance(c, RegressionTest):
214 -
                continue
215 -
216 181
            if not self._validate_check(c):
217 182
                continue
218 183

@@ -23,14 +23,11 @@
Loading
23 23
        # Match pattern, but remove spaces from the `display_name`
24 24
        display_name = case.check.display_name.replace(' ', '')
25 25
        rt = runtime()
26 -
        if not rt.get_option('general/0/compact_test_names'):
27 -
            return regex.match(case.check.unique_name)
26 +
        if '@' in patt:
27 +
            # Do an exact match on the unique name
28 +
            return patt.replace('@', '_') == case.check.unique_name
28 29
        else:
29 -
            if '@' in patt:
30 -
                # Do an exact match on the unique name
31 -
                return patt.replace('@', '_') == case.check.unique_name
32 -
            else:
33 -
                return regex.match(display_name)
30 +
            return regex.match(display_name)
34 31
35 32
    return _fn
36 33
@@ -44,15 +41,13 @@
Loading
44 41
45 42
def have_any_name(names):
46 43
    rt = runtime()
47 -
    has_compact_names = rt.get_option('general/0/compact_test_names')
48 44
    exact_matches = []
49 45
    regex_matches = []
50 46
    for n in names:
51 -
        if has_compact_names and '@' in n:
47 +
        if '@' in n:
52 48
            test, _, variant = n.rpartition('@')
53 49
            if variant.isdigit():
54 50
                exact_matches.append((test, int(variant)))
55 -
56 51
        else:
57 52
            regex_matches.append(n)
58 53
@@ -70,10 +65,7 @@
Loading
70 65
71 66
        display_name = case.check.display_name.replace(' ', '')
72 67
        if regex:
73 -
            if has_compact_names:
74 -
                return regex.match(display_name)
75 -
            else:
76 -
                return regex.match(case.check.unique_name)
68 +
            return regex.match(display_name)
77 69
78 70
        return False
79 71
Files Coverage
reframe 86.67%
Project Totals (59 files) 86.67%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading