forked from vepadulano/PyRDF
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis-unit-script.sh
59 lines (47 loc) · 1.28 KB
/
.travis-unit-script.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
#!/bin/bash
# This script is meant to be called by the "script" step defined in
# .travis.yml.
check_error()
{
local last_exit_code=$1
local last_cmd=$2
if [[ ${last_exit_code} -ne 0 ]]; then
echo "${last_cmd} exited with code ${last_exit_code}"
echo "TERMINATING TEST"
exit 1
else
echo "${last_cmd} completed successfully"
fi
}
# Install PyRDF
python setup.py install --user
# Run tests
# -x exit instantly on first error or failed test
# -v increase verbosity
pytest -x -v
check_error $? "pytest"
# Run tutorials
echo " ======== Running single-threaded tutorials ======== "
# Run single-threaded tutorials locally
for filename in ./tutorials/local/sequential/df*.py
do
echo " == Running $filename == "
python "$filename" &> /dev/null
check_error $? "$filename"
done
echo "======== Running multi-threaded tutorials ======== "
# Run multi-threaded tutorials locally
for filename in ./tutorials/local/MT/df*.py
do
echo " == Running $filename == "
python "$filename" &> /dev/null
check_error $? "$filename"
done
echo "======== Running Spark tutorials ======== "
# Run Spark tutorials locally
for filename in ./tutorials/spark/df*.py
do
echo " == Running $filename == "
python "$filename" &> /dev/null
check_error $? "$filename"
done