forked from libAtoms/workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
complete_pytest.tin
executable file
·62 lines (51 loc) · 1.91 KB
/
complete_pytest.tin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
module purge
module load compiler/gnu python/system python_extras/quippy
# should include both tin and tin_ssh - not as good as real remote machine, but maybe close enough
export EXPYRE_PYTEST_SYSTEMS='tin'
echo "GIT VERSION " $( git describe --always --tags --dirty ) > complete_pytest.tin.out
echo "" >> complete_pytest.tin.out
# buildcell
export WFL_PYTEST_BUILDCELL=$HOME/src/work/AIRSS/airss-0.9.1/src/buildcell/src/buildcell
# VASP
module load dft/vasp
export ASE_VASP_COMMAND=vasp.serial
export ASE_VASP_COMMAND_GAMMA=vasp.gamma.serial
export PYTEST_VASP_POTCAR_DIR=$VASP_PATH/pot/rev_54/PBE
# QE
module load dft/pwscf
# no ORCA
export OPENBLAS_NUM_THREADS=1
export MKL_NUM_THREADS=1
# required for descriptor calc to not hang
export OMP_NUM_THREADS=1
if [ ! -z $WFL_PYTEST_DIR ]; then
echo "Running in non-standard $WFL_PYTEST_DIR" 1>&2
pytest_dir=$WFL_PYTEST_DIR
else
pytest_dir=$HOME/pytest_wfl
fi
rm -rf $pytest_dir
pytest -v -s --basetemp $pytest_dir --runremote --runslow --runperf -rxXs "$@" >> complete_pytest.tin.out 2>&1
l=`egrep '^=.*(passed|failed|skipped|xfailed)' complete_pytest.tin.out`
echo "summary line $l"
# ========== 123 passed, 10 skipped, 235 warnings in 2887.66s (0:48:07) ==========
declare -A expected_n=( ["passed"]="123" ["skipped"]="10" ["warnings"]=235 )
echo $l | sed -E -e 's/ in .*//' -e 's/\s*,\s*/\n/g' | while read out; do
out_n=$(echo $out | sed -e 's/^=* //' -e 's/ .*//' -e 's/,//')
out_cat=$(echo $out | sed -e 's/.* //' -e 's/,//')
if [[ -z ${expected_n[$out_cat]} ]]; then
echo "Unexpected result '$out_cat' num $out_n"
exit 1
else
if [[ ${expected_n[$out_cat]} != $out_n ]]; then
echo "Unexpected number $out_n for result '$out_cat', expected ${expected_n[$out_cat]}"
exit 1
fi
fi
if [[ $out_cat == "failed" ]]; then
echo "FAILURE"
exit 2
fi
done
echo "SUCCESSS"