Skip to content
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

using an action option via mode configuration does not work #3424

Open
dmargala opened this issue Mar 12, 2025 · 2 comments
Open

using an action option via mode configuration does not work #3424

dmargala opened this issue Mar 12, 2025 · 2 comments

Comments

@dmargala
Copy link
Contributor

A colleague noticed that some of our execution mode configurations are no longer working as expected after upgrading to reframe 4.7 and pinpointed the specific commit where the behavior seemed to change:

After some manual bisection on git tag -l I found that this seems to have started breaking between 4.6.4 and 4.7.0. It looks like commit aa75c37 was the one where it started failing.

It seems like maybe an initial parsing of the cli arguments is failing before the options for the specified mode are added.

Here's a minimal reproducer:

> cat test-config.py
site_configuration = {
    'modes': [
        {
            'name': 'run',
            'options': ['--run']
        }
    ]
}
> reframe --version
4.7.1
> reframe -C test-config.py --mode=run
usage: reframe [-h] [--compress-report] [--dont-restage] [--keep-stage-files]
               [-o DIR] [--perflogdir DIR] [--prefix DIR] [--report-file FILE]
               [--report-junit FILE] [-s DIR] [--save-log-files]
               [--timestamp [TIMEFMT]] [-c PATH] [-R] [--cpu-only] [--failed]
               [--gpu-only] [--maintainer PATTERN] [-n PATTERN] [-p PATTERN]
               [-T PATTERN] [-t PATTERN] [-x PATTERN] [-E EXPR]
               (--ci-generate FILE | --delete-stored-sessions QUERY | --describe | --describe-stored-sessions QUERY | --describe-stored-testcases QUERY | --detect-host-topology [FILE] | --dry-run | -L [{C,T}] | --list-stored-sessions [QUERY] | --list-stored-testcases QUERY | -l [{C,T}] | --list-tags | --performance-compare CMPSPEC | -r | --show-config [PARAM] | -V)
               [--disable-hook NAME] [--duration TIMEOUT] [--exec-order ORDER]
               [--exec-policy POLICY] [--flex-alloc-nodes {all|STATE|NUM}]
               [--flex-alloc-strict] [-J OPT] [--max-retries NUM]
               [--maxfail NUM] [--mode MODE] [--reruns N]
               [--restore-session [REPORT]] [--retries-threshold VALUE[%]]
               [-S [TEST.]VAR=VAL] [--skip-performance-check]
               [--skip-prgenv-check] [--skip-sanity-check]
               [--skip-system-check] [-M MAPPING] [-m MOD]
               [--module-mappings FILE] [--module-path PATH]
               [--non-default-craype] [--purge-env] [-u MOD]
               [--distribute [{all|avail|STATE}]] [-P VAR:VAL0,VAL1,...]
               [--repeat N] [--performance-report [PERFORMANCE_REPORT]]
               [--session-extras KV_DATA] [-C FILE] [--failure-stats]
               [--nocolor] [--system SYSTEM]
               [--table-format {csv,pretty,plain}] [-v] [-q]
reframe: error: one of the arguments --ci-generate --delete-stored-sessions --describe --describe-stored-sessions --describe-stored-testcases --detect-host-topology --dry-run -L/--list-detailed --list-stored-sessions --list-stored-testcases -l/--list --list-tags --performance-compare -r/--run --show-config -V/--version is required
@vkarak
Copy link
Contributor

vkarak commented Mar 12, 2025

Indeed, this will not work with ReFrame >= 4.7. You will have to pass the action option outside the mode. This change of behaviour for modes has gone undocumented and we should update the docs.

Making the --mode option an "action" mode would automatically require the mode's options to include a real action (-r, -l etc.), which is against the original intent of execution modes.

@vkarak vkarak added this to the ReFrame 4.8 milestone Mar 12, 2025
@vkarak vkarak self-assigned this Mar 12, 2025
@vkarak vkarak moved this from Todo to In Progress in ReFrame Backlog Mar 12, 2025
@dmargala
Copy link
Contributor Author

ah okay, thanks for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants