Skip to content

Commit a24ded1

Browse files
committed
Unify test scripts and split into local/remote jobs
1 parent edb6424 commit a24ded1

File tree

4 files changed

+30
-37
lines changed

4 files changed

+30
-37
lines changed

.travis.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,22 @@ python:
1010
- "2.7"
1111
- "2.6"
1212

13+
before_script:
14+
- source helpers.sh
15+
1316
install:
14-
- pip install flake8
17+
- pip install flake8
1518

1619
script:
17-
# Simple test runs
18-
- ./local-install.sh
19-
- ./curl-install.sh
20+
# Test install
21+
- cat_get_pip "$TRAVIS_PYTHON_VERSION" "$SCRIPT_SRC" | python -
2022

21-
# Static analysis
22-
- pip install pyflakes pycodestyle
23-
- flake8 .
23+
# Static analysis
24+
- pip install pyflakes pycodestyle
25+
- flake8 .
2426

2527
matrix:
2628
fast_finish: true
29+
global:
30+
- SCRIPT_SRC=local
31+
- SCRIPT_SRC=remote

curl-install.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

helpers.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
function cat_get_pip() {
2+
local version="$1"
3+
local path="get-pip.py"
4+
[[ -n "$version" ]] && path="$version/$path"
5+
local src="$2"
6+
local cmd=cat
7+
if [[ "$src" == "remote" ]]
8+
then
9+
path="https://bootstrap.pypa.io/$path"
10+
cmd='wget -O - '
11+
elif [[ "$src" != "local" ]]
12+
then
13+
>&2 echo Wrong source argument: $src
14+
exit 1
15+
fi
16+
17+
$cmd $path
18+
}

local-install.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)