Skip to content

Crash with invalid test filter regex expression #909

@victorusu

Description

@victorusu

When I attempt to run the following regex expression in order to filter test

reframe -n *romacs -l

I get the stack trace

...
.../bin/reframe: unexpected error: nothing to repeat at position 0
Traceback (most recent call last):
  File ".../frontend/cli.py", line 425, in main
    checks_matched = filter(filters.have_name('|'.join(options.names)),
  File ".../frontend/check_filters.py", line 8, in have_name
    regex = re.compile(patt)
  File ".../3.6.6/lib/python3.6/re.py", line 233, in compile
    return _compile(pattern, flags)
  File ".../3.6.6/lib/python3.6/re.py", line 301, in _compile
    p = sre_compile.compile(pattern, flags)
  File ".../3.6.6/lib/python3.6/sre_compile.py", line 562, in compile
    p = sre_parse.parse(p, flags)
  File ".../3.6.6/lib/python3.6/sre_parse.py", line 855, in parse
    p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
  File ".../3.6.6/lib/python3.6/sre_parse.py", line 416, in _parse_sub
    not nested and not items))
  File ".../3.6.6/lib/python3.6/sre_parse.py", line 616, in _parse
    source.tell() - here + len(this))
sre_constants.error: nothing to repeat at position 0

I do not know what would be the best behaviour. Support this UNIX like filter or just print that this is not a valid Python regex.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions