From 736ec33324ea0d9f0980723aeb793158e1794890 Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 28 Aug 2019 08:27:41 +0200 Subject: [PATCH 1/4] build: add full Python 3 tests to Travis CI --- .travis.yml | 167 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 122 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88f0c6cdbd2887..55d4bc1d234c4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,19 @@ 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 +cache: + directories: + - $HOME/.rvm/ 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: @@ -22,12 +29,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: @@ -36,82 +47,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 + + - 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 https://goo.gl/p2fr5Q" - 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 https://goo.gl/p2fr5Q" + 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 From 431baf0f52cf130b6a7ec5646aa48d791c57ef8a Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 28 Aug 2019 17:35:53 +0200 Subject: [PATCH 2/4] Remove paste error --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 55d4bc1d234c4f..d513a68f0619b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,6 @@ env: global: - PYTHON2_VERSION="2.7.15" - PYTHON3_VERSION="3.6.7" # "3.7.1" after #29326 us fixed -cache: - directories: - - $HOME/.rvm/ jobs: include: - stage: "Compile" From a1dd1aab22e8f85e85db558644386c9cd065bb14 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 29 Aug 2019 11:43:24 +0200 Subject: [PATCH 3/4] Set up cache at a global scope --- .travis.yml | 67 ++++++++++++++--------------------------------------- 1 file changed, 18 insertions(+), 49 deletions(-) diff --git a/.travis.yml b/.travis.yml index d513a68f0619b6..79539011c62cd3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,15 +9,18 @@ language: cpp env: global: - PYTHON2_VERSION="2.7.15" - - PYTHON3_VERSION="3.6.7" # "3.7.1" after #29326 us fixed + - PYTHON3_VERSION="3.6.7" # "3.7.1" after #29326 is fixed + - PYTHON2_CACHE=$HOME/.ccache/py${PYTHON2_VERSION} + - PYTHON3_CACHE=$HOME/.ccache/py${PYTHON3_VERSION} +cache: + ccache: true + directories: + - ${PYTHON2_CACHE} + - ${PYTHON3_CACHE} jobs: include: - stage: "Compile" name: "Compile V8 (py2)" - cache: - ccache: true - directories: - - $HOME/.ccache/py${PYTHON2_VERSION} addons: apt: sources: @@ -31,11 +34,6 @@ jobs: - make -j2 -C out V=1 v8 - name: "Compile V8 (py3)" - cache: - ccache: true - directories: - - $HOME/.ccache/py${PYTHON3_VERSION} - addons: apt: sources: @@ -50,11 +48,6 @@ jobs: - make -j2 -C out V=1 v8 - name: "Compile Node.js (py2)" - cache: - ccache: true - directories: - - $HOME/.ccache/py${PYTHON2_VERSION} - addons: apt: sources: @@ -66,16 +59,10 @@ jobs: - pyenv global ${PYTHON2_VERSION} - ./configure - make -j2 V=1 - - 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 + - cp out/Release/node ${PYTHON2_CACHE} + - cp out/Release/cctest ${PYTHON2_CACHE} - name: "Compile Node.js (py3)" - cache: - ccache: true - directories: - - $HOME/.ccache/py${PYTHON3_VERSION} addons: apt: sources: @@ -88,50 +75,36 @@ jobs: # - ./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 + - cp out/Release/node ${PYTHON3_CACHE} + - cp out/Release/cctest ${PYTHON3_CACHE} - stage: "Tests" name: "Test JS Suites (py2)" - cache: - ccache: true - directories: - - $HOME/.ccache/py${PYTHON2_VERSION} install: - mkdir -p out/Release - - cp $HOME/.ccache/py${PYTHON2_VERSION}/node out/Release/node + - cp ${PYTHON2_CACHE}/node out/Release/node script: - pyenv global ${PYTHON2_VERSION} - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default - 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 + - cp ${PYTHON3_CACHE}/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/.ccache/py${PYTHON2_VERSION}/node out/Release/node + - cp ${PYTHON2_CACHE}/node out/Release/node - ln -fs out/Release/node node - - cp $HOME/.ccache/py${PYTHON2_VERSION}/cctest out/Release/cctest + - cp ${PYTHON2_CACHE}/cctest out/Release/cctest - touch config.gypi script: - pyenv global ${PYTHON2_VERSION} @@ -140,19 +113,15 @@ jobs: - python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api - name: "Test C++ Suites (py3)" - cache: - ccache: true - directories: - - $HOME/.ccache/py${PYTHON3_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/.ccache/py${PYTHON3_VERSION}/node out/Release/node + - cp ${PYTHON3_CACHE}/node out/Release/node - ln -fs out/Release/node node - - cp $HOME/.ccache/py${PYTHON3_VERSION}/cctest out/Release/cctest + - cp ${PYTHON3_CACHE}/cctest out/Release/cctest - touch config.gypi script: - pyenv global ${PYTHON3_VERSION} From 9bdf8bcef7b4c8aef1a7bf666edf0bc19f0c6358 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 29 Aug 2019 13:03:38 +0200 Subject: [PATCH 4/4] Force a retest --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 79539011c62cd3..e25aba9f3d77e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ jobs: name: "Compile V8 (py2)" addons: apt: + update: true sources: - ubuntu-toolchain-r-test packages: @@ -36,6 +37,7 @@ jobs: - name: "Compile V8 (py3)" addons: apt: + update: true sources: - ubuntu-toolchain-r-test packages: @@ -50,6 +52,7 @@ jobs: - name: "Compile Node.js (py2)" addons: apt: + update: true sources: - ubuntu-toolchain-r-test packages: @@ -65,6 +68,7 @@ jobs: - name: "Compile Node.js (py3)" addons: apt: + update: true sources: - ubuntu-toolchain-r-test packages: