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

Reusing test suites #310

Merged
merged 4 commits into from
May 17, 2019
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
28 changes: 22 additions & 6 deletions cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,14 @@ else
cp -f ${ICE_SCRIPTS}/tests/timeseries.csh ${tsdir}
cp -f ${ICE_SCRIPTS}/tests/poll_queue.csh ${tsdir}
cat >! ${tsdir}/suite.run << EOF0
foreach file (${tsdir}/suite.run ${tsdir}/suite.submit)
cat >! $file << EOF0
#!/bin/csh -f
set nonomatch && rm -f ciceexe.* && unset nonomatch
EOF0
end
cat >! ${tsdir}/results.csh << EOF0
#!/bin/csh -f
Expand All @@ -403,6 +408,7 @@ echo "#------- " >> results.log
EOF0
chmod +x ${tsdir}/suite.run
chmod +x ${tsdir}/suite.submit
chmod +x ${tsdir}/results.csh
endif
Expand Down Expand Up @@ -439,7 +445,7 @@ foreach compiler ( $ncompilers )
continue
# Check if line is a sleep line, can only happen with suites
else if ( $line:q =~ 'sleep'*) then
cat >> ${tsdir}/suite.run << EOF
cat >> ${tsdir}/suite.submit << EOF
echo "-------test--------------"
echo "$line:q"
$line:q
Expand Down Expand Up @@ -829,24 +835,34 @@ EOF2
if ( ${dosuite} == 1 ) then
cd ${ICE_SANDBOX}
# Write build and run commands to suite.run
# Write build and run commands to suite.run and suite.submit
cat >> ${tsdir}/results.csh << EOF
cat ${testname_base}/test_output >> results.log
EOF
cat >> ${tsdir}/suite.run << EOF
foreach file (${tsdir}/suite.run ${tsdir}/suite.submit)
cat >> $file << EOF
echo "-------test--------------"
echo "${testname_base}"
cd ${testname_base}
source ./cice.settings
set ciceexe = "../ciceexe.\${ICE_COMPILER}.\${ICE_COMMDIR}.\${ICE_BLDDEBUG}.\${ICE_THREADED}.\${ICE_IOTYPE}"
./cice.build \${ciceexe}
if !(-e \${ciceexe}) cp -p \${ICE_RUNDIR}/cice \${ciceexe}
EOF
end
cat >> ${tsdir}/suite.submit << EOF
./cice.submit | tee -a ../suite.jobs
EOF
cat >> ${tsdir}/suite.run << EOF
./cice.test
EOF
foreach file (${tsdir}/suite.run ${tsdir}/suite.submit)
cat >> $file << EOF
cd ..
EOF
end
# Reset case for the next test in suite
set case = ${spval}
Expand Down Expand Up @@ -905,7 +921,7 @@ EOF0
# build and submit tests
cd ${tsdir}
./suite.run | tee suite.log
./suite.submit | tee suite.log
if ($report == 1) then
echo "Reporting results"
./poll_queue.csh
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_env.buildclean
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setenv ICE_CLEANBUILD true
1 change: 1 addition & 0 deletions configuration/scripts/options/set_env.buildincremental
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
setenv ICE_CLEANBUILD false
8 changes: 6 additions & 2 deletions doc/source/user_guide/ug_running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ Some hints:
- To change the block sizes required at build time, edit the **cice.settings** file.
- To change namelist, manually edit the **ice_in** file
- To change batch settings, manually edit the top of the **cice.run** or **cice.test** (if running a test) file
- To turn on the debug compiler flags, set ``ICE_BLDDEBUG`` in **cice.setttings** to true
- To turn on the debug compiler flags, set ``ICE_BLDDEBUG`` in **cice.setttings** to true. It is also possible to use the ``debug`` option (``-s debug``) when creating the case with **cice.setup** to set this option automatically.
- To change compiler options, manually edit the Macros file
- To clean the build before each compile, set ``ICE_CLEANBUILD`` in **cice.settings** to true. To not clean before the build, set ``ICE_CLEANBUILD`` in **cice.settings** to false
- To clean the build before each compile, set ``ICE_CLEANBUILD`` in **cice.settings** to true (this is the default value), or use the ``buildclean`` option (``-s buildclean``) when creating the case with **cice.setup**. To not clean before the build, set ``ICE_CLEANBUILD`` in **cice.settings** to false, or use the ``buildincremental`` option (``-s buildincremental``) when creating the case with **cice.setup**.

To build and run::

Expand Down Expand Up @@ -164,6 +164,10 @@ Some of the options are

``debug`` which turns on the compiler debug flags

``buildclean`` which turns on the option to clean the build before each compile

``buildincremental`` which turns off the option to clean the build before each compile

``short``, ``medium``, ``long`` which change the batch time limit

``gx3``, ``gx1``, ``tx1`` are associate with grid specific settings
Expand Down
47 changes: 31 additions & 16 deletions doc/source/user_guide/ug_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env cray --testid v01a
cd testsuite.v01a
#wait for runs to complete
# wait for runs to complete
./results.csh

2) **Basic test suite with user defined test directory**
Expand All @@ -403,7 +403,7 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env cray --testid v01a --tdir /scratch/$user/ts.v01a
cd /scratch/$user/ts.v01a
#wait for runs to complete
# wait for runs to complete
./results.csh

3) **Basic test suite on multiple environments**
Expand All @@ -413,7 +413,7 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env cray,pgi,intel,gnu --testid v01a
cd testsuite.v01a
#wait for runs to complete
# wait for runs to complete
./results.csh

Each env can be run as a separate invokation of `cice.setup` but if that
Expand All @@ -426,7 +426,7 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env gnu --testid v01b --set diag1
cd testsuite.v01b
#wait for runs to complete
# wait for runs to complete
./results.csh

If there are conflicts between the ``--set`` options in the suite and on the command line,
Expand All @@ -439,11 +439,11 @@ Test Suite Examples

./cice.setup --suite base_suite,decomp_suite --mach conrad --env gnu --testid v01c
cd testsuite.v01c
#wait for runs to complete
# wait for runs to complete
./results.csh

If there are redundant tests in multiple suites, the scripts will understand that and only
create one test.
If there are redundant tests in multiple suites, the scripts will understand that and only
create one test.

6) **Basic test suite, store baselines in user defined name**

Expand All @@ -452,10 +452,10 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env cray --testid v01a --bgen cice.v01a
cd testsuite.v01a
#wait for runs to complete
# wait for runs to complete
./results.csh

This will store the results in the default [bdir] directory under the subdirectory cice.v01a.
This will store the results in the default [bdir] directory under the subdirectory cice.v01a.

7) **Basic test suite, store baselines in user defined top level directory**

Expand All @@ -464,7 +464,7 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env cray --testid v01a --bgen cice.v01a --bdir /tmp/user/CICE_BASELINES
cd testsuite.v01a
#wait for runs to complete
# wait for runs to complete
./results.csh

This will store the results in /tmp/user/CICE_BASELINES/cice.v01a.
Expand All @@ -476,11 +476,10 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env cray --testid v01a --bgen default
cd testsuite.v01a
#wait for runs to complete
# wait for runs to complete
./results.csh

This will store the results in the default [bdir] directory under a directory name generated by the script
that includes the hash and date.
This will store the results in the default [bdir] directory under a directory name generated by the script that includes the hash and date.

9) **Basic test suite, compare to prior baselines**

Expand All @@ -489,7 +488,7 @@ Test Suite Examples

./cice.setup --suite base_suite --mach conrad --env cray --testid v02a --bcmp cice.v01a
cd testsuite.v02a
#wait for runs to complete
# wait for runs to complete
./results.csh

This will compare to results saved in the baseline [bdir] directory under
Expand Down Expand Up @@ -526,7 +525,23 @@ Test Suite Examples
When this is invoked, a new set of baselines will be generated and compared to the prior
results each time without having to change the arguments.

11) **Create and test a custom suite**
11) **Reusing a test suite**

Add the buildincremental option (``-s buildincremental``). This permits the suite to be rerun without recompiling the whole code.
::

./cice.setup --suite base_suite --mach conrad --env intel --testid v01b --set buildincremental
cd testsuite.v01b
# wait for runs to complete
./results.csh
# modify code
./suite.submit # or ./suite.run to run the suite interactively
# wait for runs to complete
./results.csh

Only modified files will be recompiled, and the suite will be rerun.

12) **Create and test a custom suite**

Create your own input text file consisting of 5 columns of data,
- Test
Expand All @@ -549,7 +564,7 @@ Test Suite Examples

./cice.setup --suite mysuite --mach conrad --env cray --testid v01a --bgen default
cd testsuite.v01a
#wait for runs to complete
# wait for runs to complete
./results.csh

You can use all the standard regression testing options (``--bgen``, ``--bcmp``,
Expand Down