Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add full Python 3 tests to Travis CI #29360

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 119 additions & 45 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ os: linux
language: cpp
env:
global:
- PYTHON_VERSION="2.7.15"
- PYTHON2_VERSION="2.7.15"
- PYTHON3_VERSION="3.6.7" # "3.7.1" after #29326 us fixed
cclauss marked this conversation as resolved.
Show resolved Hide resolved
jobs:
include:
- stage: "Compile"
name: "Compile V8"
cache: ccache
name: "Compile V8 (py2)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON2_VERSION}
addons:
apt:
sources:
Expand All @@ -22,12 +26,16 @@ jobs:
- g++-6
install: *ccache-setup-steps
script:
- pyenv global ${PYTHON_VERSION}
- pyenv global ${PYTHON2_VERSION}
- ./configure
- make -j2 -C out V=1 v8

- name: "Compile Node.js"
cache: ccache
- name: "Compile V8 (py3)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON3_VERSION}

addons:
apt:
sources:
Expand All @@ -36,82 +44,148 @@ jobs:
- g++-6
install: *ccache-setup-steps
script:
- pyenv global ${PYTHON_VERSION}
- pyenv global ${PYTHON3_VERSION}
# - ./configure # workaround pending #25878
- python3 configure.py
- make -j2 -C out V=1 v8

- name: "Compile Node.js (py2)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON2_VERSION}

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
install: *ccache-setup-steps
script:
- pyenv global ${PYTHON2_VERSION}
- ./configure
- make -j2 V=1
- cp out/Release/node /home/travis/.ccache
- cp out/Release/cctest /home/travis/.ccache
- mkdir -p $HOME/.ccache/py${PYTHON2_VERSION}
- cp out/Release/node $HOME/.ccache/py${PYTHON2_VERSION}
- cp out/Release/cctest $HOME/.ccache/py${PYTHON2_VERSION}
- ls -lr $HOME/.ccache
cclauss marked this conversation as resolved.
Show resolved Hide resolved

- name: "Compile Node.js (py3)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON3_VERSION}
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
install: *ccache-setup-steps
script:
- pyenv global ${PYTHON3_VERSION}
# - ./configure # workaround pending #25878
- python3 configure.py
- make -j2 V=1
- mkdir -p $HOME/.ccache/py${PYTHON3_VERSION}
- cp out/Release/node $HOME/.ccache/py${PYTHON3_VERSION}
- cp out/Release/cctest $HOME/.ccache/py${PYTHON3_VERSION}
- ls -lr $HOME/.ccache

- stage: "Tests"
name: "Test JS Suites"
cache: ccache
name: "Test JS Suites (py2)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON2_VERSION}
install:
- mkdir -p out/Release
- cp /home/travis/.ccache/node out/Release/node
- cp $HOME/.ccache/py${PYTHON2_VERSION}/node out/Release/node
script:
- pyenv global ${PYTHON_VERSION}
- pyenv global ${PYTHON2_VERSION}
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default

- name: "Test C++ Suites"
cache: ccache
- name: "Test JS Suites (py3)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON3_VERSION}
install:
- mkdir -p out/Release
- cp $HOME/.ccache/py${PYTHON3_VERSION}/node out/Release/node
script:
- pyenv global ${PYTHON3_VERSION}
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default

- name: "Test C++ Suites (py2)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON2_VERSION}
install:
- export CCACHE_NOSTATS=1
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
- export CC='ccache gcc'
- export CXX='ccache g++'
- mkdir -p out/Release
- cp /home/travis/.ccache/node out/Release/node
- cp $HOME/.ccache/py${PYTHON2_VERSION}/node out/Release/node
- ln -fs out/Release/node node
- cp /home/travis/.ccache/cctest out/Release/cctest
- cp $HOME/.ccache/py${PYTHON2_VERSION}/cctest out/Release/cctest
- touch config.gypi
script:
- pyenv global ${PYTHON_VERSION}
- pyenv global ${PYTHON2_VERSION}
- out/Release/cctest
- make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api

- name: "Linter"
language: node_js
node_js: "node"
- name: "Test C++ Suites (py3)"
cache:
ccache: true
directories:
- $HOME/.ccache/py${PYTHON3_VERSION}
install:
- pyenv global ${PYTHON_VERSION}
- make lint-py-build || true
- export CCACHE_NOSTATS=1
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
- export CC='ccache gcc'
- export CXX='ccache g++'
- mkdir -p out/Release
- cp $HOME/.ccache/py${PYTHON3_VERSION}/node out/Release/node
- ln -fs out/Release/node node
- cp $HOME/.ccache/py${PYTHON3_VERSION}/cctest out/Release/cctest
- touch config.gypi
script:
- NODE=$(which node) make lint lint-py
- pyenv global ${PYTHON3_VERSION}
- out/Release/cctest
- make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api

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

- name: "Python 3 is EXPERIMENTAL (Py36)"
- name: "Linter (py3)"
language: node_js
node_js: "node"
install:
- pyenv global 3.6.7
- python3.6 -m pip install --upgrade pip
- make lint-py-build
- pyenv global ${PYTHON3_VERSION}
- make lint-py-build || true
script:
- NODE=$(which node) make lint lint-py
- python3.6 ./configure.py
- NODE=$(which node) make test

- name: "Python 3 is EXPERIMENTAL (Py37)"
- name: "First commit message adheres to guidelines at <a href=\"https://goo.gl/p2fr5Q\">https://goo.gl/p2fr5Q</a>"
if: type = pull_request
language: node_js
node_js: "node"
install:
- pyenv global 3.7.1
- python3.7 -m pip install --upgrade pip
- make lint-py-build
script:
- NODE=$(which node) make lint lint-py
- python3.7 ./configure.py
- NODE=$(which node) make test
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST};
fi

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