Changeset 5037


Ignore:
Timestamp:
Jul 9, 2024, 3:52:58 PM (5 months ago)
Author:
abarral
Message:

some improvements to automated tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOL/script_install_amaury/test_compils.sh

    r4929 r5037  
    44set -eu
    55
     6## Params
     7
     8#submit_cmd="sbatch -A $(/usr/sbin/my_project.py -l 2>&1 | head -1 | cut -d " " -f 3- | cut -c 5-) --constraint=GENOA --time=00:15:00 -N 1 -n 1 -c 8"  # to launch on Adastra /!\ Not working rn, since jobs don't have internet access
     9submit_cmd=""  # to launch directly
     10#base_args="-arch_dir arch_local -arch local-gfortran"  # to use local arch
     11base_args="-arch local-gfortran-parallel"
     12
     13
     14## End params
     15
     16local=$(pwd)
    617mkdir -p test_logs
    718
     
    1021
    1122    # Create test args
    12     args="-arch_dir arch_local -arch local-gfortran"
    13     if [[ ! $parallel = "none" ]]; then
    14         args="$args-parallel"
    15     fi
    16     args="$args -rad $rad -parallel $parallel -netcdf 0 -veget $veget $xios $lmdzrev $cosp"
     23    local args="$base_args -rad $rad -parallel $parallel -netcdf 0 -veget $veget $xios $lmdzrev $cosp"
    1724    # trim
    1825    args=$(echo "$args" | xargs)
    1926
    20     logfile="test_logs/$args.out"
    21     if [[ -f $logfile ]]; then return; fi
     27    local logfile="$local/test_logs/$args.out"
     28    if [[ -f $logfile ]]; then return; fi  # ALready exists = test already ran
    2229    echo "Testing $args"
    23     rm -rf LMDZ
    2430
     31    # Create temp folder
     32    mkdir -p "test_logs/${args// /_}_$$" && cd "test_logs/${args// /_}_$$"
     33    cp ../../install_lmdz.sh .
    2534
    2635    # shellcheck disable=SC2086
    27     if ! ./install_lmdz.sh -name LMDZ $args > "$logfile" 2>&1; then
     36    local test_cmd="$submit_cmd ./install_lmdz.sh -name LMDZ $args"
     37    if ! $test_cmd > "$logfile" 2>&1; then
    2838        # Check bench success if bench
    2939        if (grep -q "EXECUTION DU BENCH" < "$logfile") && (! grep -q "Everything is cool" < "$logfile"); then
     
    3646
    3747function run_all_tests {
     48    cd "$local"
    3849    for parallel in "none" "mpi_omp"; do
    3950    for rad in "oldrad" "rrtm" "ecrad"; do
     
    4152    for xios in "" "-xios"; do
    4253      if [[ $xios = "-xios" && $parallel = "none" ]]; then continue; fi
    43     for lmdzrev in "" "-r 4894"; do  # TODO when base lmdz becomes >=4894, change condition for lmdzrev=""
    44         if [[ (! $veget = "none") && ($parallel = "none") && ($(echo "$lmdzrev" | cut -c 4-) -lt 4894) ]]; then continue; fi
     54    for lmdzrev in ""; do
    4555    for cosp in "" "-cosp v1" "-cosp v2"; do
    4656        do_one_test
     
    5464
    5565function display_results {
    56     cd "test_logs"
     66    cd "$local/test_logs"
    5767    echo "Success=o, Failure=XXX, non-breaking error=/!\\"
    5868    echo "INSTALL  BENCH  NAME"
    59     for fname in *; do
     69    for fname in *.out; do
    6070        if [[ $(tail -n 1 -- "$fname") = " Everything is cool" ]]; then
    6171            if grep -q "Error" < "$fname"; then
Note: See TracChangeset for help on using the changeset viewer.