Skip to content

Commit

Permalink
cice.setup: allow command line to override suite options
Browse files Browse the repository at this point in the history
Options chosen on the 'cice.setup' command line (using the '-s' flag) are
added to the options defined for each test in the test suite definition
file, when running a test suite.

This is implemented by appending the options from the test suite (in
variable 'sets_tmp') to the options from the command line ('sets_base')
in the variable 'sets', which is ultimately (via the variable 'setsx')
looped through to apply each option.

Since 'sets_tmp' is appended to 'sets_base', options on the command line
can't override options from the test suite file, which means one can't
e.g. run a test suite with 'kdyn=3' and expect all tests to use this
option if any option specified in the test suite set 'kdyn' to some
other value.

To allow options from the command line to override options from the test
suite, reverse the order in which 'sets_tmp' and 'sets_base' are used to
define 'sets'. This is in line with the common behaviour of the command
line taking precedence.

Adjust the documentation accordingly, fixing a typo along the way.
  • Loading branch information
phil-blain committed Aug 2, 2022
1 parent 21bd95b commit b19149d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ EOF
set bfbcomp_tmp = `echo $line | cut -d' ' -f5`
# Append sets from .ts file to the $sets variable
set sets = "$sets_base,$sets_tmp"
set sets = "$sets_tmp,$sets_base"
# Create a new bfbcomp_base variable to store bfbcomp passed to cice.setup
# Use bfbcomp_base or bfbcomp_tmp
Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide/ug_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ If a user adds ``--set`` to the suite, all tests in that suite will add that opt

./cice.setup --suite base_suite,decomp_suite --mach wolf --env gnu --testid myid -s debug

The option settings defined in the suite have precendence over the command line
The option settings defined at the command line have precedence over the test suite
values if there are conflicts.

The predefined test suites are defined under **configuration/scripts/tests** and
Expand Down Expand Up @@ -474,7 +474,7 @@ Test Suite Examples
./results.csh

If there are conflicts between the ``--set`` options in the suite and on the command line,
the suite will take precedence.
the command line options will take precedence.

5) **Multiple test suites from a single command line**

Expand Down

0 comments on commit b19149d

Please sign in to comment.