From b927e50c53d4db8841ce917b76226f571463d5a1 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 9 Sep 2017 17:45:00 +0200 Subject: [PATCH 1/3] test: FocusGained: retry() cmdline-mode test --- test/functional/terminal/tui_spec.lua | 40 ++++++++++++++------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 09b28589ac..d36eb46e54 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -293,25 +293,27 @@ describe('tui FocusGained/FocusLost', function() feed_data(":autocmd!\n") feed_data(":autocmd FocusLost * call append(line('$'), 'lost')\n") feed_data(":autocmd FocusGained * call append(line('$'), 'gained')\n") - -- Enter cmdline-mode. - feed_data(':') - screen:sleep(1) - -- Send focus lost/gained termcodes. - feed_data('\027[O') - feed_data('\027[I') - screen:sleep(1) - -- Exit cmdline-mode. Redraws from timers/events are blocked during - -- cmdline-mode, so the buffer won't be updated until we exit cmdline-mode. - feed_data('\n') - screen:expect([[ - {1: } | - lost | - gained | - {4:~ }| - {5:[No Name] [+] }| - : | - {3:-- TERMINAL --} | - ]]) + retry(2, 3 * screen.timeout, function() + -- Enter cmdline-mode. + feed_data(':') + screen:sleep(1) + -- Send focus lost/gained termcodes. + feed_data('\027[O') + feed_data('\027[I') + screen:sleep(1) + -- Exit cmdline-mode. Redraws from timers/events are blocked during + -- cmdline-mode, so the buffer won't be updated until we exit cmdline-mode. + feed_data('\n') + screen:expect([[ + {1: } | + lost | + gained | + {4:~ }| + {5:[No Name] [+] }| + : | + {3:-- TERMINAL --} | + ]]) + end) end) it('in terminal-mode', function() From 23cc41df555fba7345e0403eff3f4b3483cb2747 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 9 Sep 2017 16:44:38 +0200 Subject: [PATCH 2/3] ci/travis: report python environment info --- ci/before_install.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ci/before_install.sh b/ci/before_install.sh index 5b36adaef2..7279152fb0 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -11,6 +11,18 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then brew update fi +echo 'python info:' +( + 2>&1 python --version || true + 2>&1 python2 --version || true + 2>&1 python3 --version || true + 2>&1 pip --version || true + 2>&1 pip2 --version || true + 2>&1 pip3 --version || true + echo 'pyenv versions:' + 2>&1 pyenv versions || true +) | sed 's/^/ /' + echo "Upgrade Python 2 pip." pip2.7 -q install --user --upgrade pip From 6389bde0bc966e5a5850735b0b1605f7fca233f9 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 9 Sep 2017 21:26:40 +0200 Subject: [PATCH 3/3] ci/travis: skip pip3 upgrade if pip3 is missing Workaround for travis issue: https://github.com/travis-ci/travis-ci/issues/8363 Sometimes `pip3` works, sometimes not: pyenv: pip3: command not found The `pip3' command exists in these Python versions: 3.5 3.5.3 Tried these steps to fix the issue: - add `python: 3.6` to top level of `.travis.yml` - add `python3` to `addons.apt.packages` level of `.travis.yml` - `pyenv global system 3.{4,5,6}` - `pyenv global 3.6` In all cases the presence or absence of `pip3` was random. --- ci/before_install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/before_install.sh b/ci/before_install.sh index 7279152fb0..8b0603eb16 100755 --- a/ci/before_install.sh +++ b/ci/before_install.sh @@ -32,6 +32,10 @@ if [[ "${TRAVIS_OS_NAME}" == osx ]]; then echo "Upgrade Python 3 pip." pip3 -q install --user --upgrade pip else - echo "Upgrade Python 3 pip." - pip3 -q install --user --upgrade pip + if command -v pip3 ; then + echo "Upgrade Python 3 pip." + pip3 -q install --user --upgrade pip + else + echo 'warning: missing pip3' + fi fi