-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_tests.sh
executable file
·60 lines (53 loc) · 1.33 KB
/
run_tests.sh
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
#!/bin/bash
download_example () {
# expects args PATH EXAMPLE_NAME
echo -n "Downloading $1/$2..."
wget https://raw.githubusercontent.com/pyvista/pyvista/main/$1/$2 -P $1 -q
FILE=/etc/resolv.conf
if test -f "$1/$2"; then
echo " Done"
else
echo " Failed"
fi
}
# create a virtual environment and install requirements
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt -q
# clear out old benchmarks (optional, should use a command line arg)
rm -rf .benchmarks
# clone pyvista examples
rm -rf pyvista
git clone --depth 1 https://github.com/pyvista/pyvista.git
# Declare an array of string with type
declare -a Versions=(
"0.20.4"
"0.21.4"
"0.22.4"
"0.23.1"
"0.24.3"
"0.25.3"
"0.26.1"
"0.27.4"
"0.28.1"
"0.29.1"
"0.30.1"
"0.31.3"
"0.32.1"
"0.33.3"
"0.34.0"
"main"
)
# Iterate the string array using for loop
for version in ${Versions[@]}; do
echo "Benchmarking PyVista" $version
if [ "$version" = "main" ]; then
pip install .pyvista/
else
pip install pyvista==$version -q
fi
pytest tests/ --benchmark-save=$version --benchmark-quiet --disable-warnings --no-header
done
mkdir hist -p
rm hist/*
pytest-benchmark compare --histogram hist/hist --group-by name --sort fullname 1> /dev/null