forked from appium/python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.sh
executable file
·37 lines (30 loc) · 971 Bytes
/
ci.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
#!/bin/bash
set -o pipefail
EXIT_STATUS=0
if ! python -m autopep8 --exit-code -a -r --global-config .config-pep8 -i . ; then
echo "Please run command 'python -m autopep8 -a -r --global-config .config-pep8 -i .' on your local and commit the result"
EXIT_STATUS=1
fi
if ! python -m isort --check-only -rc . ; then
echo "Please run command 'python -m isort -rc .' on your local and commit the result"
EXIT_STATUS=1
fi
(
LINT_RESULT=$(python -m pylint --rcfile .pylintrc appium test --errors-only 2>&1 | tee /dev/tty)
if [[ $? -ne 0 ]] ; then
EXIT_STATUS=1
fi
# FIXME: pylint x Python 3.7 cause this runtime error.
# We must remove here when we drop Python 2 (and can update pylint) or
# install newer pylint for Python 3.7 environment on CI
if [[ $LINT_RESULT =~ "RuntimeError: generator raised StopIteration" ]] ; then
EXIT_STATUS=0
fi
)
(
python -m pytest test/unit/
)
if [[ $? -ne 0 ]] ; then
EXIT_STATUS=1
fi
exit $EXIT_STATUS