From 0995f460fbebdfd7d76b8932f73ea958033c92b1 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 7 Oct 2018 13:23:23 +0200 Subject: [PATCH 1/4] CI/travis/macOS: fix missing pip3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit homebrew or Travis changed something, now `pip3` isn't in $PATH. `ls /usr/local/opt/python/libexec/bin` confirmed this, no matter what brew reinstall/relink/upgrade are used. Bumping the macOS image to 10.12 or 10.13 makes the problem go away. ==> Processing gcc49 formula rename to gcc@4.9 ==> Unlinking gcc49 ==> Moving gcc49 versions to /usr/local/Cellar/gcc@4.9 ==> Relinking gcc@4.9 Warning: gcc@4.9 is outdated! To avoid broken installations, as soon as possible please run: brew upgrade Or, if you're OK with a less reliable fix: brew upgrade gcc@4.9 python info: Python 2.7.12 Python 2.7.12 ci/before_install.sh: line 18: python3: command not found pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7) pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7) ci/before_install.sh: line 21: pip3: command not found pyenv versions: * system (set by /Users/travis/.pyenv/version) Upgrade Python 3. To restore the stashed changes to /usr/local/Homebrew run: 'cd /usr/local/Homebrew && git stash pop' ==> Caveats Python has been installed as /usr/local/bin/python3 Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to `python3`, `python3-config`, `pip3` etc., respectively, have been installed into /usr/local/opt/python/libexec/bin If you need Homebrew's Python 2.7 run brew install python@2 Pip, setuptools, and wheel have been installed. To update them run pip3 install --upgrade pip setuptools wheel You can install Python packages with pip3 install They will install into the site-package directory /usr/local/lib/python3.7/site-packages See: https://docs.brew.sh/Homebrew-and-Python ==> Summary º /usr/local/Cellar/python/3.7.0: 8,864 files, 153.8MB, built in 6 minutes 32 seconds ... Upgrade Python 3 pip. ci/before_install.sh: line 30: pip3: command not found travis_time:end:0d23f522:start=1538818824750644000,finish=1538819451424021000,duration=626673377000 The command "ci/before_install.sh" failed and exited with 127 during . Your build has been stopped. /Users/travis/.travis/job_stages: line 373: shell_session_update: command not found ==> Processing gcc49 formula rename to gcc@4.9 ==> Unlinking gcc49 ==> Moving gcc49 versions to /usr/local/Cellar/gcc@4.9 ==> Relinking gcc@4.9 Warning: gcc@4.9 is outdated! To avoid broken installations, as soon as possible please run: brew upgrade Or, if you're OK with a less reliable fix: brew upgrade gcc@4.9 python info: Python 2.7.12 Python 2.7.12 ci/before_install.sh: line 18: python3: command not found pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7) pip 8.1.2 from /usr/local/lib/python2.7/site-packages (python 2.7) ci/before_install.sh: line 21: pip3: command not found pyenv versions: * system (set by /Users/travis/.pyenv/version) Upgrade Python 3. To restore the stashed changes to /usr/local/Homebrew run: 'cd /usr/local/Homebrew && git stash pop' ==> Caveats Python has been installed as /usr/local/bin/python3 Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to `python3`, `python3-config`, `pip3` etc., respectively, have been installed into /usr/local/opt/python/libexec/bin If you need Homebrew's Python 2.7 run brew install python@2 Pip, setuptools, and wheel have been installed. To update them run pip3 install --upgrade pip setuptools wheel You can install Python packages with pip3 install They will install into the site-package directory /usr/local/lib/python3.7/site-packages See: https://docs.brew.sh/Homebrew-and-Python ==> Summary º /usr/local/Cellar/python/3.7.0: 8,864 files, 153.8MB, built in 6 minutes 32 seconds ... Upgrade Python 3 pip. ci/before_install.sh: line 30: pip3: command not found travis_time:end:0d23f522:start=1538818824750644000,finish=1538819451424021000,duration=626673377000 The command "ci/before_install.sh" failed and exited with 127 during . Your build has been stopped. /Users/travis/.travis/job_stages: line 373: shell_session_update: command not found --- .travis.yml | 4 ++-- ci/before_install.sh | 14 +++++++------- ci/install.sh | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index fa884bd021..8ad9d7a6fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,10 +69,10 @@ jobs: env: BUILD_32BIT=ON - os: osx compiler: clang - osx_image: xcode7.3 # macOS 10.11 + osx_image: xcode9.4 # macOS 10.13 - os: osx compiler: gcc - osx_image: xcode7.3 # macOS 10.11 + osx_image: xcode9.4 # macOS 10.13 - os: linux env: CI_TARGET=lint - stage: Flaky builds diff --git a/ci/before_install.sh b/ci/before_install.sh index 9a3e192536..6610d7d3d5 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -9,6 +9,8 @@ fi if [[ "${TRAVIS_OS_NAME}" == osx ]]; then brew update + echo "Upgrade Python 3" + brew upgrade python fi echo 'python info:' @@ -24,17 +26,15 @@ echo 'python info:' ) | sed 's/^/ /' if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - echo "Upgrade Python 3." - brew upgrade python - echo "Upgrade Python 3 pip." + echo "Upgrade Python 3 pip" pip3 -q install --user --upgrade pip else - echo "Upgrade Python 2 pip." - pip2.7 -q install --user --upgrade pip - echo "Upgrade Python 3 pip." + echo "Upgrade Python 2 pip" + python2.7 -m pip -q install --user --upgrade pip + echo "Upgrade Python 3 pip" # Allow failure. pyenv pip3 on travis is broken: # https://github.com/travis-ci/travis-ci/issues/8363 - pip3 -q install --user --upgrade pip || true + python3 -m pip -q install --user --upgrade pip || true fi echo "Install node (LTS)" diff --git a/ci/install.sh b/ci/install.sh index e95e2f29c1..2cb8e78e67 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -18,14 +18,14 @@ fi echo "Install neovim module for Python 3." # Allow failure. pyenv pip3 on travis is broken: # https://github.com/travis-ci/travis-ci/issues/8363 -CC=cc pip3 -q install --user --upgrade neovim || true +CC=cc python3 -m pip -q install --user --upgrade neovim || true if ! [ "${TRAVIS_OS_NAME}" = osx ] ; then # Update PATH for pip. export PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH" # Use default CC to avoid compilation problems when installing Python modules. echo "Install neovim module for Python 2." - CC=cc pip2.7 -q install --user --upgrade neovim + CC=cc python2.7 -m pip -q install --user --upgrade neovim echo "Install neovim RubyGem." gem install --no-document --version ">= 0.2.0" neovim From e39dade80b023bc6ac1b5592d1e1637d0c1a2502 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 8 Oct 2018 08:56:13 +0200 Subject: [PATCH 2/4] test: adjust timer tests Timer tests are less reliable on Travis CI macOS 10.12 (most egregious). Also somewhat on 10.13. --- src/nvim/testdir/test_timers.vim | 7 +++++-- test/functional/eval/timer_spec.lua | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index 6450bf02e8..82afeb76c8 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -20,9 +20,9 @@ func Test_oneshot() let slept = WaitFor('g:val == 1') call assert_equal(1, g:val) if has('reltime') - call assert_inrange(40, 100, slept) + call assert_inrange(40, 120, slept) else - call assert_inrange(20, 100, slept) + call assert_inrange(20, 120, slept) endif endfunc @@ -39,6 +39,7 @@ func Test_repeat_three() endfunc func Test_repeat_many() + call timer_stopall() let g:val = 0 let timer = timer_start(50, 'MyHandler', {'repeat': -1}) sleep 200m @@ -89,6 +90,7 @@ func Test_info() endfunc func Test_stopall() + call timer_stopall() let id1 = timer_start(1000, 'MyHandler') let id2 = timer_start(2000, 'MyHandler') let info = timer_info() @@ -161,6 +163,7 @@ func StopTimerAll(timer) endfunc func Test_stop_all_in_callback() + call timer_stopall() let g:timer1 = timer_start(10, 'StopTimerAll') let info = timer_info() call assert_equal(1, len(info)) diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index 8afc3592cc..040ab30522 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -1,6 +1,6 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') -local ok, feed, eq, eval = helpers.ok, helpers.feed, helpers.eq, helpers.eval +local feed, eq, eval = helpers.feed, helpers.eq, helpers.eval local source, nvim_async, run = helpers.source, helpers.nvim_async, helpers.run local clear, command, funcs = helpers.clear, helpers.command, helpers.funcs local curbufmeths = helpers.curbufmeths @@ -72,7 +72,8 @@ describe('timers', function() run(nil, nil, nil, 300) feed("") local diff = eval("g:val") - count - ok(0 <= diff and diff <= 4) + assert(0 <= diff and diff <= 4, + 'expected (0 <= diff <= 4), got: '..tostring(diff)) end) it('are triggered in blocking getchar() call', function() @@ -81,7 +82,7 @@ describe('timers', function() run(nil, nil, nil, 300) feed("c") local count = eval("g:val") - ok(count >= 4) + assert(count >= 4, 'expected count >= 4, got: '..tostring(count)) eq(99, eval("g:c")) end) @@ -142,9 +143,10 @@ describe('timers', function() local count = eval("g:val") run(nil, nil, nil, 300) local count2 = eval("g:val") - ok(4 <= count and count <= 7) -- when count is eval:ed after timer_stop this should be non-racy eq(count, count2) + assert(4 <= count and count <= 7, + 'expected (4 <= count <= 7), got: '..tostring(count)) end) it('can be stopped from the handler', function() From 3d2493a3fd724edc382922e91147f893dcb0f904 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 8 Oct 2018 05:38:45 +0200 Subject: [PATCH 3/4] CI/travis/macOS: use "sudo rm" to remove cores After bumping Travis macOS to 10.13, it now hangs at: + check_core_dumps --delete quiet + local del= + test --delete = --delete + del=1 + shift + local app=quiet + test osx = osx ++ find /cores/ -type f -print + local 'cores=/cores//core.554 /cores//core.641 /cores//core.801' + test -z '/cores//core.554 /cores//core.641 /cores//core.801' + local core + for core in '$cores' + test 1 = 1 + print_core quiet /cores//core.554 + local app=quiet + local core=/cores//core.554 + test quiet = quiet + echo 'Found core /cores//core.554' Found core /cores//core.554 + return 0 + rm /cores//core.554 override r-------- root/admin for /cores//core.554? The cores are always present on the Travis macOS 10.13 image! Hilarious. --- ci/common/test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/common/test.sh b/ci/common/test.sh index bc80dfead7..a6afd1df4c 100644 --- a/ci/common/test.sh +++ b/ci/common/test.sh @@ -34,8 +34,10 @@ check_core_dumps() { local app="${1:-${BUILD_DIR}/bin/nvim}" if test "${TRAVIS_OS_NAME}" = osx ; then local cores="$(find /cores/ -type f -print)" + local _sudo='sudo' else local cores="$(find ./ -type f -name 'core.*' -print)" + local _sudo= fi if test -z "${cores}" ; then @@ -45,7 +47,7 @@ check_core_dumps() { for core in $cores; do if test "$del" = "1" ; then print_core "$app" "$core" >&2 - rm "$core" + "$_sudo" rm "$core" else print_core "$app" "$core" fi From 78418e17e90fb06a4a0a09bbef88d36428d1f938 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 8 Oct 2018 07:13:05 +0200 Subject: [PATCH 4/4] CI/travis/macOS: silence non-error messages from homebrew Reduces the log size by 11% (1100/9670 lines). --- ci/before_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/before_install.sh b/ci/before_install.sh index 6610d7d3d5..2a8eb9ce1f 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -8,9 +8,9 @@ if [[ "${CI_TARGET}" == lint ]]; then fi if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - brew update + >/dev/null brew update echo "Upgrade Python 3" - brew upgrade python + >/dev/null brew upgrade python fi echo 'python info:'