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

rose stem: allow comma separated --task --group #1197

Merged
merged 2 commits into from Apr 1, 2014
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/rose-stem
Expand Up @@ -42,11 +42,11 @@
# fcm-make config files are taken from it. Further source trees can be
# added with additional --source arguments.
# Defaults to '.' if not specified.
# --group=GROUP, -g GROUP
# --group=GROUP[,GROUP2[,...]], -g GROUP[,GROUP2[,...]]
# Specify a group name to run. Additional groups can be specified
# with further --group arguments. The suite will then convert the groups
# into a series of tasks to run..
# --task=GROUP, -t GROUP
# --task=TASK[,TASK2[,...]], -t TASK[,TASK2[,...]]
# Synonym for --group.
#
# JINJA2 VARIABLES
Expand Down
4 changes: 2 additions & 2 deletions doc/rose-command.html
Expand Up @@ -1385,13 +1385,13 @@ <h3>OPTIONS</h3>All options of <a href="#rose-suite-run">rose suite-run</a>
can be added with additional --source arguments. Defaults to '.' if not
specified.</dd>

<dt><kbd>--group=GROUP, -g GROUP</kbd></dt>
<dt><kbd>--group=GROUP[,GROUP2[,...]], -g GROUP[,GROUP2[,...]]</kbd></dt>

<dd>Specify a group name to run. Additional groups can be specified with
further --group arguments. The suite will then convert the groups into a
series of tasks to run.</dd>

<dt><kbd>--task=GROUP, -t GROUP</kbd></dt>
<dt><kbd>--task=TASK[,TASK2[,...]], -t TASK[,TASK2[,...]]</kbd></dt>

<dd>Synonym for --group.</dd>
</dl>
Expand Down
5 changes: 4 additions & 1 deletion lib/python/rose/stem.py
Expand Up @@ -294,8 +294,11 @@ def process(self):
if self.opts.group:
if not self.opts.defines:
self.opts.defines = []
expanded_groups = []
for i in self.opts.group:
expanded_groups.extend(i.split(','))
self.opts.defines.append(SUITE_RC_PREFIX + 'RUN_NAMES=' +
str(self.opts.group))
str(expanded_groups))

# Change into the suite directory
if self.opts.conf_dir:
Expand Down
8 changes: 5 additions & 3 deletions t/rose-stem/00-run-basic.t
Expand Up @@ -59,12 +59,14 @@ tests $N_TESTS
#Test for successful execution
TEST_KEY=$TEST_KEY_BASE-basic-check
run_pass "$TEST_KEY" \
rose stem --group=earl_grey --source=$WORKINGCOPY --source=fcm:foo_tr@head \
--no-gcontrol --name $SUITENAME -- --debug
rose stem --group=earl_grey --task=milk,sugar --group=spoon,cup,milk \
--source=$WORKINGCOPY --source=fcm:foo_tr@head --no-gcontrol \
--name $SUITENAME -- --debug
#Test output
OUTPUT=$HOME/cylc-run/$SUITENAME/log/job/my_task_1.1.1.out
TEST_KEY=$TEST_KEY_BASE-basic-groups-to-run
file_grep $TEST_KEY "RUN_NAMES=\[earl_grey\]" $OUTPUT
file_grep $TEST_KEY "RUN_NAMES=\[earl_grey, milk, sugar, spoon, cup, milk\]" \
$OUTPUT
TEST_KEY=$TEST_KEY_BASE-basic-source
file_grep $TEST_KEY "SOURCE_FOO=$WORKINGCOPY fcm:foo_tr@head" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-basic-source-base
Expand Down