on master help sign in
Merge pull request #811 from dalf/geckodriver
02bba2aAdam Tauber
manage.sh+32
@@ -14,6 +14,36 @@ update_dev_packages() {
14 pip install --upgrade -r "$BASE_DIR/requirements-dev.txt"
14 pip install --upgrade -r "$BASE_DIR/requirements-dev.txt"
15}
15}
16
16
17+check_geckodriver() {
18+ echo '[!] Checking geckodriver'
19+ set -e
20+ geckodriver -V 2>1 > /dev/null || NOTFOUND=1
21+ set +e
22+ if [ -z $NOTFOUND ]; then
23+ return
24+ fi
25+ GECKODRIVER_VERSION="v0.11.1"
26+ PLATFORM=`python -c "import platform; print platform.system().lower(), platform.architecture()[0]"`
27+ case $PLATFORM in
28+ "linux 32bit" | "linux2 32bit") ARCH="linux32";;
29+ "linux 64bit" | "linux2 64bit") ARCH="linux64";;
30+ "windows 32 bit") ARCH="win32";;
31+ "windows 64 bit") ARCH="win64";;
32+ "mac 64bit") ARCH="macos";;
33+ esac
34+ GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-$ARCH.tar.gz";
35+ if [ -z "$VIRTUAL_ENV" ]; then
36+ echo "geckodriver can't be installed because VIRTUAL_ENV is not set, you should download it from\n $GECKODRIVER_URL"
37+ exit
38+ else
39+ echo "Installing $VIRTUAL_ENV from\n $GECKODRIVER_URL"
40+ FILE=`mktemp`
41+ wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C $VIRTUAL_ENV/bin/ -f $FILE geckodriver
42+ rm $FILE
43+ chmod 777 $VIRTUAL_ENV/bin/geckodriver
44+ fi
45+}
46+
17pep8_check() {
47pep8_check() {
18 echo '[!] Running pep8 check'
48 echo '[!] Running pep8 check'
19 # ignored rules:
49 # ignored rules:
@@ -43,6 +73,7 @@ tests() {
43 set -e
73 set -e
44 pep8_check
74 pep8_check
45 unit_tests
75 unit_tests
76+ check_geckodriver
46 robot_tests
77 robot_tests
47 set +e
78 set +e
48}
79}
@@ -88,6 +119,7 @@ Commands
88 unit_tests - Run unit tests
119 unit_tests - Run unit tests
89 update_dev_packages - Check & update development and production dependency changes
120 update_dev_packages - Check & update development and production dependency changes
90 update_packages - Check & update dependency changes
121 update_packages - Check & update dependency changes
122+ check_geckodriver - Check & download geckodriver (required for robot_tests)
91"
123"
92}
124}
93
125