New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
sette.sh in utils/CI/sette – NEMO

source: utils/CI/sette/sette.sh @ 13900

Last change on this file since 13900 was 13887, checked in by gsamson, 4 years ago

initialize SETTE_TIMING to 'no' when not using '-T' option (otherwise string comparison test fails in sette_reference-configurations.sh and sette_test-cases.sh)

  • Property svn:executable set to *
File size: 3.4 KB
RevLine 
[11161]1#!/bin/sh
2# initialise user dependent variable
[3520]3SETTE_DIR=$(cd $(dirname "$0"); pwd)
[6460]4MAIN_DIR=$(dirname $SETTE_DIR)
[13887]5export SETTE_TIMING='no'
[3520]6
[11161]7# Parse command-line arguments
8if [ $# -gt 0 ]; then
[13790]9  while getopts t:x:cshT option; do
[11161]10     case $option in
[12569]11        c) export SETTE_CLEAN_CONFIGS='yes'
12           export SETTE_SYNC_CONFIGS='yes'
13           echo ""
14           echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation"
15           echo "";;
16        s) export SETTE_SYNC_CONFIGS='yes'
17           echo ""
18           echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration"
19           echo "";;
[13568]20        t) export SETTE_TEST_CONFIGS=($OPTARG)
[11161]21           echo ""
[13568]22           if [ ${#SETTE_TEST_CONFIGS[@]} -gt 1 ]; then
23             echo "Configurations ${SETTE_TEST_CONFIGS[@]} will be tested if they are available"
24           else
25             echo "Configuration ${SETTE_TEST_CONFIGS[@]} will be tested if it is available"
26           fi
[11161]27           echo "" ;;
[13568]28        x) export SETTE_TEST_TYPES=($OPTARG)
29           ;;
[13790]30        T) export SETTE_TIMING='yes'
31           echo ""
32           echo "ln_timing will be set to true"
33           echo "";;
[13568]34        h | *) echo 'sette.sh with no arguments (in this case all configuration will be tested)'
[12569]35               echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations'
[13568]36               echo '-x "TEST_type TEST_type ..." to specify particular types of test (RESTART is mandatory)'
[13790]37               echo '-T to set ln_timing true for all non-AGRIF configurations'
[12569]38               echo '-c to clean each configuration'
39               echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;;
[11161]40     esac
41  done
42  shift $((OPTIND - 1))
[3520]43fi
44
[11161]45. ./param.cfg
[3520]46
[13568]47if [ ${#SETTE_TEST_CONFIGS[@]} -eq 0 ]; then
48   echo ""
49   echo "Configurations $TEST_CONFIGS will be tested if they are available"
50   echo ""
51fi
52echo ""
53echo "Carrying out the following tests: ${TEST_TYPES[@]}"
54echo ""
55
[11161]56# run sette on reference configuration
[13568]57. ./sette_reference-configurations.sh
[11161]58if [[ $? != 0 ]]; then
59   echo ""
60   echo "--------------------------------------------------------------"
61   echo "./sette_cfg-ref.sh didn't finish properly, need investigations"
62   echo "--------------------------------------------------------------"
63   echo ""
64   exit 42
[3520]65fi
66
[11161]67# run sette on test cases
[13568]68. ./sette_test-cases.sh
[11161]69if [[ $? != 0 ]]; then
70   echo ""
71   echo "-----------------------------------------------------------------"
72   echo "./sette_test-cases.sh didn't finish properly, need investigations"
73   echo "-----------------------------------------------------------------"
74   echo ""
75   exit 42
[3520]76fi
77
[11161]78# run sette report
79echo ""
80echo "-------------------------------------------------------------"
81echo "./sette_rpt.sh (script will wait all nemo_sette run are done)"
82echo "-------------------------------------------------------------"
83echo ""
84NRUN=999
85NIT=0
86while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do
87   nit=$((nit+1))
[12569]88   NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) 
[11161]89   if [[ $NRUN -ne 0 ]]; then
[12569]90      printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...';
[11161]91   else
92      printf "%-50s\n" " "
[13568]93      . ./sette_rpt.sh
[11161]94      exit
95   fi
96   sleep 10
[3520]97done
[11161]98printf "\n"
99echo ""
100echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests"
101echo ""
Note: See TracBrowser for help on using the repository browser.