forked from vepadulano/PyRDF
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests.sh
More file actions
125 lines (94 loc) · 3.31 KB
/
run_tests.sh
File metadata and controls
125 lines (94 loc) · 3.31 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
echo "\nPlease enter the path or command that refers to your python binary ! \n"
echo "Some examples : \n"
echo "\"python3\""
echo "\"/usr/bin/python\""
echo "\"python\" (This will be the default)\n"
echo "Enter the path/command here : \n(Simply Press Enter to pick the default value)\n"
read python_bin
if [ -z "$python_bin" ] # Check empty input
then
python_bin=python
fi
echo "======== Installing PyRDF from setup ========\n"
$python_bin setup.py install --user --prefix= || {
echo "\033[0;31m Error ! \033[0m This error could occur due to one of the below reasons : "
echo "1. 'setup.py' is not in the current directory"
echo "2. You don't have write permissions to site-packages folder"
exit 1
}
echo "\n \033[0;32m Installed successfully ! \033[0m \n" # Print in green
$python_bin -c "import enum" || pip install --user enum34 || easy_install enum34 || {
echo "\"pip install --user enum34\" and \"easy_install enum34\" didn't work. Please find a way to install the package 'enum34'"
exit 1
}
echo "======== Running tests ========\n"
echo "\nPlease enter the command for running python tests using nose ! \n"
echo "Some examples : \n"
echo "\"nosetests\" (This will be the default)"
echo "\"nosetests-2.7\""
echo "Enter the command here : \n(Simply Press Enter to pick the default value)\n"
read nose_bin
if [ -z "$nose_bin" ] # Check empty input
then
nose_bin=nosetests
fi
$nose_bin tests/unit/*.py || {
echo "Please install nose and make sure that you're inside the PyRDF directory !"
exit 1
}
$nose_bin tests/unit/backend/*.py || {
echo "Please install nose and make sure that you're inside the PyRDF directory !"
exit 1
}
$nose_bin tests/integration/local/*.py || {
echo "Please install nose and make sure that you're inside the PyRDF directory !"
exit 1
}
$nose_bin tests/integration/spark/*.py || {
echo "Please install nose and make sure that you're inside the PyRDF directory !"
exit 1
}
echo "\n \033[0;32m Ran tests successfully ! \033[0m \n"
echo "======== Running single-threaded tutorials ========\n"
{
# Run single-threaded tutorials locally
for filename in ./tutorials/local/sequential/df*.py
do
echo "\n== Running $filename ==\n"
$python_bin "$filename"
echo "\n \033[0;32m Ran $filename successfully ! \033[0m"
done
} || {
echo "Error in running tutorials ! Check if you're in the PyRDF root directory !"
exit 1
}
echo "\n======== \033[0;32m Ran single-threaded tutorials successfully ! \033[0m ========\n"
echo "======== Running multi-threaded tutorials ========\n"
{
# Run multi-threaded tutorials locally
for filename in ./tutorials/local/MT/df*.py
do
echo "\n== Running $filename ==\n"
$python_bin "$filename"
echo "\n \033[0;32m Ran $filename successfully ! \033[0m"
done
} || {
echo "Error in running tutorials ! Check if you're in the PyRDF root directory !"
exit 1
}
echo "\n======== \033[0;32m Ran multi-threaded tutorials successfully ! \033[0m ========\n"
echo "======== Running Spark tutorials ========\n"
{
# Run Spark tutorials locally
for filename in ./tutorials/spark/df*.py
do
echo "\n== Running $filename ==\n"
$python_bin "$filename"
echo "\n \033[0;32m Ran $filename successfully ! \033[0m"
done
} || {
echo "Error in running tutorials ! Check if you're in the PyRDF root directory !"
exit 1
}
echo "\n======== \033[0;32m Ran Spark tutorials successfully ! \033[0m ========\n"