Skip to content

Commit 256da1f

Browse files
cclaussBridgeAR
authored andcommitted
build: add full Python 3 tests to Travis CI
PR-URL: #29360 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com>
1 parent 5a16449 commit 256da1f

File tree

1 file changed

+92
-45
lines changed

1 file changed

+92
-45
lines changed

.travis.yml

+92-45
Original file line numberDiff line numberDiff line change
@@ -8,110 +8,157 @@ os: linux
88
language: cpp
99
env:
1010
global:
11-
- PYTHON_VERSION="2.7.15"
11+
- PYTHON2_VERSION="2.7.15"
12+
- PYTHON3_VERSION="3.6.7" # "3.7.1" after #29326 is fixed
13+
- PYTHON2_CACHE=$HOME/.ccache/py${PYTHON2_VERSION}
14+
- PYTHON3_CACHE=$HOME/.ccache/py${PYTHON3_VERSION}
15+
cache:
16+
ccache: true
17+
directories:
18+
- ${PYTHON2_CACHE}
19+
- ${PYTHON3_CACHE}
1220
jobs:
1321
include:
1422
- stage: "Compile"
15-
name: "Compile V8"
16-
cache: ccache
23+
name: "Compile V8 (py2)"
1724
addons:
1825
apt:
26+
update: true
1927
sources:
2028
- ubuntu-toolchain-r-test
2129
packages:
2230
- g++-6
2331
install: *ccache-setup-steps
2432
script:
25-
- pyenv global ${PYTHON_VERSION}
33+
- pyenv global ${PYTHON2_VERSION}
2634
- ./configure
2735
- make -j2 -C out V=1 v8
2836

29-
- name: "Compile Node.js"
30-
cache: ccache
37+
- name: "Compile V8 (py3)"
3138
addons:
3239
apt:
40+
update: true
3341
sources:
3442
- ubuntu-toolchain-r-test
3543
packages:
3644
- g++-6
3745
install: *ccache-setup-steps
3846
script:
39-
- pyenv global ${PYTHON_VERSION}
47+
- pyenv global ${PYTHON3_VERSION}
48+
# - ./configure # workaround pending #25878
49+
- python3 configure.py
50+
- make -j2 -C out V=1 v8
51+
52+
- name: "Compile Node.js (py2)"
53+
addons:
54+
apt:
55+
update: true
56+
sources:
57+
- ubuntu-toolchain-r-test
58+
packages:
59+
- g++-6
60+
install: *ccache-setup-steps
61+
script:
62+
- pyenv global ${PYTHON2_VERSION}
4063
- ./configure
4164
- make -j2 V=1
42-
- cp out/Release/node /home/travis/.ccache
43-
- cp out/Release/cctest /home/travis/.ccache
65+
- cp out/Release/node ${PYTHON2_CACHE}
66+
- cp out/Release/cctest ${PYTHON2_CACHE}
67+
68+
- name: "Compile Node.js (py3)"
69+
addons:
70+
apt:
71+
update: true
72+
sources:
73+
- ubuntu-toolchain-r-test
74+
packages:
75+
- g++-6
76+
install: *ccache-setup-steps
77+
script:
78+
- pyenv global ${PYTHON3_VERSION}
79+
# - ./configure # workaround pending #25878
80+
- python3 configure.py
81+
- make -j2 V=1
82+
- cp out/Release/node ${PYTHON3_CACHE}
83+
- cp out/Release/cctest ${PYTHON3_CACHE}
4484

4585
- stage: "Tests"
46-
name: "Test JS Suites"
47-
cache: ccache
86+
name: "Test JS Suites (py2)"
87+
install:
88+
- mkdir -p out/Release
89+
- cp ${PYTHON2_CACHE}/node out/Release/node
90+
script:
91+
- pyenv global ${PYTHON2_VERSION}
92+
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default
93+
94+
- name: "Test JS Suites (py3)"
4895
install:
4996
- mkdir -p out/Release
50-
- cp /home/travis/.ccache/node out/Release/node
97+
- cp ${PYTHON3_CACHE}/node out/Release/node
5198
script:
52-
- pyenv global ${PYTHON_VERSION}
99+
- pyenv global ${PYTHON3_VERSION}
53100
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default
54101

55-
- name: "Test C++ Suites"
56-
cache: ccache
102+
- name: "Test C++ Suites (py2)"
57103
install:
58104
- export CCACHE_NOSTATS=1
59105
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
60106
- export CC='ccache gcc'
61107
- export CXX='ccache g++'
62108
- mkdir -p out/Release
63-
- cp /home/travis/.ccache/node out/Release/node
109+
- cp ${PYTHON2_CACHE}/node out/Release/node
64110
- ln -fs out/Release/node node
65-
- cp /home/travis/.ccache/cctest out/Release/cctest
111+
- cp ${PYTHON2_CACHE}/cctest out/Release/cctest
66112
- touch config.gypi
67113
script:
68-
- pyenv global ${PYTHON_VERSION}
114+
- pyenv global ${PYTHON2_VERSION}
69115
- out/Release/cctest
70116
- make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
71117
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api
72118

73-
- name: "Linter"
74-
language: node_js
75-
node_js: "node"
119+
- name: "Test C++ Suites (py3)"
76120
install:
77-
- pyenv global ${PYTHON_VERSION}
78-
- make lint-py-build || true
121+
- export CCACHE_NOSTATS=1
122+
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
123+
- export CC='ccache gcc'
124+
- export CXX='ccache g++'
125+
- mkdir -p out/Release
126+
- cp ${PYTHON3_CACHE}/node out/Release/node
127+
- ln -fs out/Release/node node
128+
- cp ${PYTHON3_CACHE}/cctest out/Release/cctest
129+
- touch config.gypi
79130
script:
80-
- NODE=$(which node) make lint lint-py
131+
- pyenv global ${PYTHON3_VERSION}
132+
- out/Release/cctest
133+
- make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
134+
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api
81135

82-
- name: "First commit message adheres to guidelines at <a href=\"https://goo.gl/p2fr5Q\">https://goo.gl/p2fr5Q</a>"
83-
if: type = pull_request
136+
- name: "Linter (py2)"
84137
language: node_js
85138
node_js: "node"
139+
install:
140+
- pyenv global ${PYTHON2_VERSION}
141+
- make lint-py-build || true
86142
script:
87-
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
88-
bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST};
89-
fi
143+
- NODE=$(which node) make lint lint-py
90144

91-
- name: "Python 3 is EXPERIMENTAL (Py36)"
145+
- name: "Linter (py3)"
92146
language: node_js
93147
node_js: "node"
94148
install:
95-
- pyenv global 3.6.7
96-
- python3.6 -m pip install --upgrade pip
97-
- make lint-py-build
149+
- pyenv global ${PYTHON3_VERSION}
150+
- make lint-py-build || true
98151
script:
99152
- NODE=$(which node) make lint lint-py
100-
- python3.6 ./configure.py
101-
- NODE=$(which node) make test
102153

103-
- name: "Python 3 is EXPERIMENTAL (Py37)"
154+
- name: "First commit message adheres to guidelines at <a href=\"https://goo.gl/p2fr5Q\">https://goo.gl/p2fr5Q</a>"
155+
if: type = pull_request
104156
language: node_js
105157
node_js: "node"
106-
install:
107-
- pyenv global 3.7.1
108-
- python3.7 -m pip install --upgrade pip
109-
- make lint-py-build
110158
script:
111-
- NODE=$(which node) make lint lint-py
112-
- python3.7 ./configure.py
113-
- NODE=$(which node) make test
159+
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
160+
bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST};
161+
fi
114162

115163
allow_failures:
116-
- name: "Python 3 is EXPERIMENTAL (Py36)"
117-
- name: "Python 3 is EXPERIMENTAL (Py37)"
164+
- name: "Test C++ Suites (py3)" # allow_failures pending #29246

0 commit comments

Comments
 (0)