Skip to content

Commit 9e85816

Browse files
author
Dmitry Ivanov
committed
Sudoless travis.yml
1 parent fee0d3a commit 9e85816

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.travis.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ otp_release:
44
- 18.0
55
- 17.0
66

7+
sudo: false
8+
79
env:
810
- TASK=lint
911
- TASK=dialyzer
@@ -17,26 +19,38 @@ env:
1719
- TASK=acceptance-negative-tests
1820
- TASK=http-worker-tests
1921

22+
addons:
23+
apt:
24+
packages:
25+
- python-virtualenv
26+
27+
cache:
28+
directories:
29+
- $HOME/.cache/pip
30+
- $HOME/.cache/rebar3
31+
2032
script:
33+
- virtualenv venv
34+
- source venv/bin/activate
2135
- ./bin/rebar3 update
2236
- export PROJECTS="node server common_apps/mzbench_language common_apps/mzbench_utils";
2337
- case "$TASK" in
24-
lint) sudo pip install pyflakes && ./bin/lint.py . ;;
25-
validate-examples) sudo pip install -r requirements.txt && make -C examples check;;
26-
error-messages) sudo pip install -r requirements.txt && make -C acceptance_tests/invalid_scripts check;;
27-
http-worker-tests) sudo pip install -r requirements.txt &&
38+
lint) pip install pyflakes && ./bin/lint.py . ;;
39+
validate-examples) pip install -r requirements.txt && make -C examples check;;
40+
error-messages) pip install -r requirements.txt && make -C acceptance_tests/invalid_scripts check;;
41+
http-worker-tests) pip install -r requirements.txt &&
2842
export NODE_COMMIT=`git rev-parse HEAD` &&
2943
export MZBENCH_REPO=`pwd` &&
3044
cd workers/http &&
3145
make && make check-local;;
32-
acceptance-*-tests) sudo pip install -r requirements.txt &&
33-
sudo pip install -r acceptance_tests/requirements.txt &&
46+
acceptance-*-tests) pip install -r requirements.txt &&
47+
pip install -r acceptance_tests/requirements.txt &&
3448
export NODE_COMMIT=`git rev-parse HEAD` &&
3549
export MZBENCH_REPO=`pwd` &&
3650
cd acceptance_tests &&
3751
make ${TASK/acceptance-/};;
38-
development-with-rsync) sudo pip install -r requirements.txt &&
39-
sudo pip install -r acceptance_tests/requirements.txt &&
52+
development-with-rsync) pip install -r requirements.txt &&
53+
pip install -r acceptance_tests/requirements.txt &&
4054
export MZBENCH_RSYNC=$PWD/ &&
4155
rm node/Makefile &&
4256
make -C acceptance_tests quick-test >/dev/null; [ $? -ne 0 ] &&

bin/lint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def lint_python(root):
2323
pyflakes = find_executable('pyflakes')
2424

2525
python_files = [os.path.join(root, 'bin/mzbench')] + list(files_with_extension('.py', root))
26-
return subprocess.call([pyflakes] + python_files)
26+
return subprocess.call([pyflakes] +
27+
[f for f in python_files if '/venv/' not in f])
2728

2829

2930
def lint_escript(root):

0 commit comments

Comments
 (0)