-
Notifications
You must be signed in to change notification settings - Fork 0
/
weetest.sh
55 lines (43 loc) · 1.48 KB
/
weetest.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
#!/bin/sh
#
# automate running the weewx benchmarks
# ref: https://github.com/weewx/weewx/wiki/Benchmarks-of-file-and-image-generation
#
# location of benchmark
BENCHMARK_TGZ="https://weewx.com/benchmarks/weewx-benchmark.tar.gz"
# location of test-use-only weewx installation
TEST_DIR="/var/tmp/weetest"
# location the benchmark will extract to
BENCHMARK_DIR="/var/tmp/weewx-benchmark"
#---- stop editing here ---
#
# we send weectl output to /dev/null
# because there is no --quiet option
#
# similarly we send pip error output to /dev/null
# to suppress deprecation warnings
echo "... installing weewx to a test directory ..."
mkdir ${TEST_DIR}
cd ${TEST_DIR}
python3 -m venv weetest-venv
source weetest-venv/bin/activate
pip3 install weewx --quiet 2>/dev/null
# if Tom uses mac tar it can add things to the tarball
# ref: https://superuser.com/questions/318809/linux-os-x-tar-incompatibility-tarballs-created-on-os-x-give-errors-when-unt
echo "... downloading and extracting benchmark code ..."
wget -qO- ${BENCHMARK_TGZ} | tar xz --warning=no-unknown-keyword -C /var/tmp
if [ -d ${BENCHMARK_DIR}/public_html ]
then
echo "... cleaning up previous benchmark runs ..."
rm -r ${BENCHMARK_DIR}/public_html
fi
echo "... running the weewx benchmark ..."
wee_reports ${BENCHMARK_DIR}/weewx.conf
echo "... deactivating python venv ..."
deactivate
echo "... done ..."
echo ""
echo "To remove the test-use weewx, benchmark code, and data:"
echo " rm -r ${TEST_DIR}"
echo " rm -r ${BENCHMARK_DIR}"
echo ""