Skip to content

[bugfix] Treat = properly when parameterizing tests with --parameterize #3530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ def _case_failed(t):
params = {}
for param_spec in options.parameterize:
try:
var, values_spec = param_spec.split('=')
var, values_spec = param_spec.split('=', maxsplit=1)
except ValueError:
raise errors.CommandLineError(
f'invalid parameter spec: {param_spec}'
Expand Down
10 changes: 5 additions & 5 deletions unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1061,16 +1061,16 @@ def test_repeat_negative(run_reframe):

def test_parameterize_tests(run_reframe):
returncode, stdout, _ = run_reframe(
more_options=['-P', 'num_tasks=2,4,8', '-n', '^HelloTest'],
more_options=['-P', 'descr=msg=hello1,msg=hello2',
'-n', '^HelloTest'],
checkpath=['unittests/resources/checks/hellocheck.py'],
action='describe'
)
assert returncode == 0

test_descr = json.loads(stdout)
print(json.dumps(test_descr, indent=2))
num_tasks = {t['num_tasks'] for t in test_descr}
assert num_tasks == {2, 4, 8}
test_json = json.loads(stdout)
descr = [t['descr'] for t in test_json]
assert descr == ['msg=hello1', 'msg=hello2']


def test_parameterize_tests_invalid_params(run_reframe):
Expand Down
Loading