From eae276b53967a8f17716ab1783e4de6d631b614d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 9 Sep 2017 21:40:19 +0200 Subject: [PATCH 01/18] travis: Initial .travis.yml update for containers --- .travis.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec2868730..ec2f6a0b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ -sudo: required +sudo: false dist: trusty -language: generic +language: python group: edge matrix: @@ -20,19 +20,15 @@ matrix: env: DOCKER=ubuntu-xenial services: docker - os: linux - language: python python: 3.6 env: TESTENV=py36-pyqt571 - os: linux - language: python python: 3.6 env: TESTENV=py36-pyqt58 - os: linux - language: python python: 3.5 env: TESTENV=py35-pyqt59 - os: linux - language: python python: 3.6 env: TESTENV=py36-pyqt59 - os: osx @@ -44,7 +40,6 @@ matrix: # osx_image: xcode6.4 - os: linux env: TESTENV=pylint PYTHON=python3.6 - language: python python: 3.6 - os: linux env: TESTENV=flake8 From 49a389542e04c2e51b1562b771acd88f3501d541 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 9 Sep 2017 22:03:16 +0200 Subject: [PATCH 02/18] travis: Update travis_install.sh --- .travis.yml | 4 ---- scripts/dev/ci/travis_install.sh | 12 ++++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec2f6a0b7..4429cc0d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,10 +66,6 @@ cache: - $HOME/.cache/pip - $HOME/build/qutebrowser/qutebrowser/.cache -before_install: - # We need to do this so we pick up the system-wide python properly - - 'export PATH="/usr/bin:$PATH"' - install: - bash scripts/dev/ci/travis_install.sh - ulimit -c unlimited diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index 53bcf06e8..dd9d47640 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -60,7 +60,7 @@ brew_install() { pip_install() { # this uses python2 - travis_retry sudo -H python -m pip install "$@" + travis_retry python -m pip install "$@" } npm_install() { @@ -124,22 +124,22 @@ case $TESTENV in check_pyqt ;; py3*-pyqt*) - apt_install xvfb geoclue gdb apport + #apt_install xvfb geoclue gdb apport ;; pylint|vulture) - apt_install $pyqt_pkgs libpython3.4-dev + #apt_install $pyqt_pkgs libpython3.4-dev check_pyqt ;; flake8) - apt_install libpython3.4-dev + #apt_install libpython3.4-dev ;; docs) - apt_install $pyqt_pkgs asciidoc libpython3.4-dev + #apt_install $pyqt_pkgs asciidoc libpython3.4-dev asciidoc --version check_pyqt ;; misc) - apt_install libpython3.4-dev + #apt_install libpython3.4-dev ;; pyroma|check-manifest) ;; From b4f30f6df260ad0d5fdf36500f1091c807378fdf Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 01:14:52 +0200 Subject: [PATCH 03/18] Move coverage to QtWebEngine environment with PyPI-PyQt --- .travis.yml | 4 +- qutebrowser/browser/history.py | 6 +- .../browser/webkit/certificateerror.py | 2 +- .../mainwindow/statusbar/backforward.py | 1 - qutebrowser/misc/miscwidgets.py | 3 +- qutebrowser/utils/urlutils.py | 2 +- scripts/dev/check_coverage.py | 8 +-- scripts/dev/ci/travis_install.sh | 5 -- tests/unit/utils/usertypes/test_question.py | 9 +++ tox.ini | 63 +++++++++---------- 10 files changed, 47 insertions(+), 56 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4429cc0d5..fd2e8d172 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,6 @@ group: edge matrix: include: - - os: linux - env: TESTENV=py34-cov - os: linux env: DOCKER=debian-jessie services: docker @@ -30,7 +28,7 @@ matrix: env: TESTENV=py35-pyqt59 - os: linux python: 3.6 - env: TESTENV=py36-pyqt59 + env: TESTENV=py36-pyqt59-cov - os: osx env: TESTENV=py36 OSX=elcapitan osx_image: xcode7.3 diff --git a/qutebrowser/browser/history.py b/qutebrowser/browser/history.py index 2d5c263bc..c6624e157 100644 --- a/qutebrowser/browser/history.py +++ b/qutebrowser/browser/history.py @@ -173,9 +173,7 @@ class WebHistory(sql.SqlTable): (hidden in completion) atime: Override the atime used to add the entry """ - if not url.isValid(): # pragma: no cover - # the no cover pragma is a WORKAROUND for this not being covered in - # old Qt versions. + if not url.isValid(): log.misc.warning("Ignoring invalid URL being added to history") return @@ -320,6 +318,6 @@ def init(parent=None): history = WebHistory(parent=parent) objreg.register('web-history', history) - if objects.backend == usertypes.Backend.QtWebKit: + if objects.backend == usertypes.Backend.QtWebKit: # pragma: no cover from qutebrowser.browser.webkit import webkithistory webkithistory.init(history) diff --git a/qutebrowser/browser/webkit/certificateerror.py b/qutebrowser/browser/webkit/certificateerror.py index d02ded76c..1d2df1562 100644 --- a/qutebrowser/browser/webkit/certificateerror.py +++ b/qutebrowser/browser/webkit/certificateerror.py @@ -41,7 +41,7 @@ class CertificateErrorWrapper(usertypes.AbstractCertificateErrorWrapper): try: # Qt >= 5.4 return hash(self._error) - except TypeError: # pragma: no cover + except TypeError: return hash((self._error.certificate().toDer(), self._error.error())) diff --git a/qutebrowser/mainwindow/statusbar/backforward.py b/qutebrowser/mainwindow/statusbar/backforward.py index fe044e621..3a566e105 100644 --- a/qutebrowser/mainwindow/statusbar/backforward.py +++ b/qutebrowser/mainwindow/statusbar/backforward.py @@ -30,7 +30,6 @@ class Backforward(textbase.TextBase): """Called on URL changes.""" tab = tabs.currentWidget() if tab is None: # pragma: no cover - # WORKAROUND: Doesn't get tested on older PyQt self.setText('') self.hide() return diff --git a/qutebrowser/misc/miscwidgets.py b/qutebrowser/misc/miscwidgets.py index b4a17e638..94be76734 100644 --- a/qutebrowser/misc/miscwidgets.py +++ b/qutebrowser/misc/miscwidgets.py @@ -245,8 +245,7 @@ class WrapperLayout(QLayout): def sizeHint(self): return self._widget.sizeHint() - def itemAt(self, _index): # pragma: no cover - # For some reason this sometimes gets called by Qt. + def itemAt(self, _index): return None def takeAt(self, _index): diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index 4cd0e94d0..71174b270 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -605,7 +605,7 @@ def safe_display_string(qurl): raise InvalidUrlError(qurl) host = qurl.host(QUrl.FullyEncoded) - if '..' in host: + if '..' in host: # pragma: no cover # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-60364 return '(unparseable URL!) {}'.format(qurl.toDisplayString()) diff --git a/scripts/dev/check_coverage.py b/scripts/dev/check_coverage.py index e22d3a155..14d3a9f49 100644 --- a/scripts/dev/check_coverage.py +++ b/scripts/dev/check_coverage.py @@ -53,8 +53,6 @@ PERFECT_FILES = [ 'browser/webkit/cookies.py'), ('tests/unit/browser/test_history.py', 'browser/history.py'), - ('tests/unit/browser/test_history.py', - 'browser/webkit/webkithistory.py'), ('tests/unit/browser/webkit/http/test_http.py', 'browser/webkit/http.py'), ('tests/unit/browser/webkit/http/test_content_disposition.py', @@ -73,7 +71,7 @@ PERFECT_FILES = [ ('tests/unit/browser/test_signalfilter.py', 'browser/signalfilter.py'), (None, - 'browser/webkit/certificateerror.py'), + 'browser/webengine/certificateerror.py'), # ('tests/unit/browser/test_tab.py', # 'browser/tab.py'), @@ -272,8 +270,8 @@ def main_check(): subprocess.check_call([sys.executable, '-m', 'coverage', 'report', '--show-missing', '--include', filters]) print() - print("To debug this, run 'tox -e py35-cov' (or py34-cov) locally and " - "check htmlcov/index.html") + print("To debug this, run 'tox -e py36-pyqt59-cov' " + "(or py35-pyqt59-cov) locally and check htmlcov/index.html") print("or check https://codecov.io/github/qutebrowser/qutebrowser") print() diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index dd9d47640..62314b2b1 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -118,11 +118,6 @@ pip --version tox --version case $TESTENV in - py34-cov) - pip_install -r misc/requirements/requirements-codecov.txt - apt_install xvfb $pyqt_pkgs libpython3.4-dev gdb apport libqt5webkit5-dbg python3-pyqt5-dbg python3-pyqt5.qtquick-dbg python3-pyqt5.qtwebkit-dbg python3-dbg - check_pyqt - ;; py3*-pyqt*) #apt_install xvfb geoclue gdb apport ;; diff --git a/tests/unit/utils/usertypes/test_question.py b/tests/unit/utils/usertypes/test_question.py index 031e304cc..b11c01b6a 100644 --- a/tests/unit/utils/usertypes/test_question.py +++ b/tests/unit/utils/usertypes/test_question.py @@ -89,3 +89,12 @@ def test_abort_typeerror(question, qtbot, mocker, caplog): with caplog.at_level(logging.ERROR, 'misc'): question.abort() assert caplog.records[0].message == 'Error while aborting question' + + +def test_abort_twice(question, qtbot): + """Abort a question twice.""" + with qtbot.wait_signal(question.aborted): + question.abort() + assert question.is_aborted + with qtbot.assert_not_emitted(question.aborted): + question.abort() diff --git a/tox.ini b/tox.ini index 04cf826d1..e916f4a83 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py36-cov,misc,vulture,flake8,pylint,pyroma,check-manifest,eslint +envlist = py36-pyqt59-cov,misc,vulture,flake8,pylint,pyroma,check-manifest,eslint distshare = {toxworkdir} skipsdist = true @@ -21,39 +21,6 @@ commands = {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} -bb -m pytest {posargs:tests} - -# test envs with coverage - -[testenv:py36-cov] -basepython = python3.6 -setenv = {[testenv]setenv} -passenv = {[testenv]passenv} -deps = {[testenv]deps} -commands = - {envpython} scripts/link_pyqt.py --tox {envdir} - {envpython} -bb -m pytest --cov --cov-report xml --cov-report=html --cov-report= {posargs:tests} - {envpython} scripts/dev/check_coverage.py {posargs} - -[testenv:py35-cov] -basepython = python3.5 -setenv = {[testenv]setenv} -passenv = {[testenv]passenv} -deps = {[testenv]deps} -commands = - {envpython} scripts/link_pyqt.py --tox {envdir} - {envpython} -bb -m pytest --cov --cov-report xml --cov-report=html --cov-report= {posargs:tests} - {envpython} scripts/dev/check_coverage.py {posargs} - -[testenv:py34-cov] -basepython = python3.4 -setenv = {[testenv]setenv} -passenv = {[testenv]passenv} -deps = {[testenv]deps} -commands = - {envpython} scripts/link_pyqt.py --tox {envdir} - {envpython} -bb -m pytest --cov --cov-report xml --cov-report=html --cov-report= {posargs:tests} - {envpython} scripts/dev/check_coverage.py {posargs} - # test envs with PyQt5 from PyPI [testenv:py35-pyqt56] @@ -133,6 +100,34 @@ deps = PyQt5==5.9 commands = {envpython} -bb -m pytest {posargs:tests} +# test envs with coverage + +[testenv:py35-pyqt59-cov] +basepython = python3.6 +setenv = + {[testenv]setenv} + QUTE_BDD_WEBENGINE=true +passenv = {[testenv]passenv} +deps = + {[testenv]deps} + PyQt5==5.9 +commands = + {envpython} -bb -m pytest --cov --cov-report xml --cov-report=html --cov-report= {posargs:tests} + {envpython} scripts/dev/check_coverage.py {posargs} + +[testenv:py36-pyqt59-cov] +basepython = python3.5 +setenv = + {[testenv]setenv} + QUTE_BDD_WEBENGINE=true +passenv = {[testenv]passenv} +deps = + {[testenv]deps} + PyQt5==5.9 +commands = + {envpython} -bb -m pytest --cov --cov-report xml --cov-report=html --cov-report= {posargs:tests} + {envpython} scripts/dev/check_coverage.py {posargs} + # other envs [testenv:mkvenv] From a11baeb84d1cf39e8d92fd60e78b9be960c63e11 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 01:44:53 +0200 Subject: [PATCH 04/18] travis: Fix some more issues --- .travis.yml | 7 +++++++ scripts/dev/ci/travis_install.sh | 7 +++---- tox.ini | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fd2e8d172..f9de7fd9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,10 @@ matrix: env: TESTENV=flake8 - os: linux env: TESTENV=docs + addons: + apt: + packages: + - asciidoc - os: linux env: TESTENV=vulture - os: linux @@ -53,6 +57,9 @@ matrix: env: TESTENV=check-manifest - os: linux env: TESTENV=eslint + language: node_js + python: null + node_js: node allow_failures: - os: osx env: TESTENV=py36 OSX=elcapitan diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index 62314b2b1..eeb2ffec2 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -65,8 +65,8 @@ pip_install() { npm_install() { # Make sure npm is up-to-date first - travis_retry sudo npm install -g npm - travis_retry sudo npm install -g "$@" + travis_retry npm install -g npm + travis_retry npm install -g "$@" } install_node() { @@ -123,7 +123,7 @@ case $TESTENV in ;; pylint|vulture) #apt_install $pyqt_pkgs libpython3.4-dev - check_pyqt + #check_pyqt ;; flake8) #apt_install libpython3.4-dev @@ -139,7 +139,6 @@ case $TESTENV in pyroma|check-manifest) ;; eslint) - install_node echo "node: $(node --version)" echo "npm: $(npm --version)" npm_install eslint diff --git a/tox.ini b/tox.ini index e916f4a83..5ec438f8c 100644 --- a/tox.ini +++ b/tox.ini @@ -191,9 +191,9 @@ basepython = python3 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/misc/requirements/requirements-vulture.txt + -r{toxinidir}/misc/requirements/requirements-pyqt.txt setenv = PYTHONPATH={toxinidir} commands = - {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} scripts/dev/run_vulture.py [testenv:pylint] @@ -250,8 +250,8 @@ whitelist_externals = git passenv = TRAVIS_PULL_REQUEST deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/misc/requirements/requirements-pyqt.txt commands = - {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} scripts/dev/src2asciidoc.py {posargs} {envpython} scripts/dev/check_doc_changes.py {posargs} {envpython} scripts/asciidoc2html.py {posargs} From 1491f20201066dee1e073012dfa2fe4f0195a6ce Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 02:00:21 +0200 Subject: [PATCH 05/18] Remove geolocation tests They just cause more trouble than they're worth. --- pytest.ini | 4 ---- tests/end2end/features/prompts.feature | 16 ---------------- 2 files changed, 20 deletions(-) diff --git a/pytest.ini b/pytest.ini index 999a6b05a..40b11614e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -44,10 +44,6 @@ qt_log_ignore = ^QWaitCondition: Destroyed while threads are still waiting ^QXcbXSettings::QXcbXSettings\(QXcbScreen\*\) Failed to get selection owner for XSETTINGS_S atom ^QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to .* - ^QGeoclueMaster error creating GeoclueMasterClient\. - ^Geoclue error: Process org\.freedesktop\.Geoclue\.Master exited with status 127 - ^QDBusConnection: name 'org.freedesktop.Geoclue.Master' had owner '' but we thought it was ':1.1' - ^Failed to create Geoclue client interface. Geoclue error: org\.freedesktop\.DBus\.Error\.Disconnected ^QObject::connect: Cannot connect \(null\)::stateChanged\(QNetworkSession::State\) to QNetworkReplyHttpImpl::_q_networkSessionStateChanged\(QNetworkSession::State\) ^QXcbClipboard: Cannot transfer data, no data available ^load glyph failed diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature index e733d69b1..8a3f785e6 100644 --- a/tests/end2end/features/prompts.feature +++ b/tests/end2end/features/prompts.feature @@ -219,22 +219,6 @@ Feature: Prompts And I run :click-element id button Then the javascript message "geolocation permission denied" should be logged - @ci @not_mac @qt!=5.8 - Scenario: Always accepting geolocation - When I set content -> geolocation to true - And I open data/prompt/geolocation.html in a new tab - And I run :click-element id button - Then the javascript message "geolocation permission denied" should not be logged - - @ci @not_mac @qt!=5.8 - Scenario: geolocation with ask -> true - When I set content -> geolocation to ask - And I open data/prompt/geolocation.html in a new tab - And I run :click-element id button - And I wait for a prompt - And I run :prompt-accept yes - Then the javascript message "geolocation permission denied" should not be logged - Scenario: geolocation with ask -> false When I set content -> geolocation to ask And I open data/prompt/geolocation.html in a new tab From e6864b6599e8dd6bda704f41d330c808bd9737be Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 13:17:21 +0200 Subject: [PATCH 06/18] travis: Run eslint without tox on Travis --- scripts/dev/ci/travis_install.sh | 44 +++----------------------------- scripts/dev/ci/travis_run.sh | 4 +++ tox.ini | 2 ++ 3 files changed, 10 insertions(+), 40 deletions(-) diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index eeb2ffec2..cf86991ed 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -109,43 +109,7 @@ elif [[ $TRAVIS_OS_NAME == osx ]]; then exit 0 fi -pyqt_pkgs="python3-pyqt5 python3-pyqt5.qtquick python3-pyqt5.qtwebkit python3-pyqt5.qtsql libqt5sql5-sqlite" - -pip_install pip -pip_install -r misc/requirements/requirements-tox.txt - -pip --version -tox --version - -case $TESTENV in - py3*-pyqt*) - #apt_install xvfb geoclue gdb apport - ;; - pylint|vulture) - #apt_install $pyqt_pkgs libpython3.4-dev - #check_pyqt - ;; - flake8) - #apt_install libpython3.4-dev - ;; - docs) - #apt_install $pyqt_pkgs asciidoc libpython3.4-dev - asciidoc --version - check_pyqt - ;; - misc) - #apt_install libpython3.4-dev - ;; - pyroma|check-manifest) - ;; - eslint) - echo "node: $(node --version)" - echo "npm: $(npm --version)" - npm_install eslint - echo "eslint: $(eslint --version)" - ;; - *) - echo "Unknown testenv $TESTENV!" >&2 - exit 1 - ;; -esac +if [[ $TESTENV != eslint ]]; then + pip_install pip + pip_install -r misc/requirements/requirements-tox.txt +fi diff --git a/scripts/dev/ci/travis_run.sh b/scripts/dev/ci/travis_run.sh index 80a45026a..2457b81c1 100644 --- a/scripts/dev/ci/travis_run.sh +++ b/scripts/dev/ci/travis_run.sh @@ -2,6 +2,10 @@ if [[ $DOCKER ]]; then docker run --privileged -v $PWD:/outside -e QUTE_BDD_WEBENGINE=$QUTE_BDD_WEBENGINE -e DOCKER=$DOCKER qutebrowser/travis:$DOCKER +elif [[ $TESTENV == eslint ]]; then + # Can't run this via tox as we can't easily install tox in the javascript travis env + cd qutebrowser/javascript || exit 1 + eslint --color . else args=() [[ $TRAVIS_OS_NAME == osx ]] && args=('--qute-bdd-webengine' '--no-xvfb') diff --git a/tox.ini b/tox.ini index 5ec438f8c..fbdcdda44 100644 --- a/tox.ini +++ b/tox.ini @@ -268,6 +268,8 @@ commands = {envbindir}/pyinstaller --noconfirm misc/qutebrowser.spec [testenv:eslint] +# This is duplicated in travis_run.sh for Travis CI because we can't get tox in +# the JavaScript environment easily. deps = whitelist_externals = eslint changedir = {toxinidir}/qutebrowser/javascript From 816369f0ef8d576a946bfb4ca2670801131f97f6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 13:21:03 +0200 Subject: [PATCH 07/18] travis: Clean up Travis scripts --- scripts/dev/ci/travis_install.sh | 24 +----------------------- scripts/dev/ci/travis_run.sh | 4 ++-- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index cf86991ed..f5884d4ac 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -1,3 +1,4 @@ +#!/bin/bash # vim: ft=sh fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2017 Florian Bruhin (The Compiler) @@ -42,17 +43,6 @@ travis_retry() { return $result } -apt_install() { - sudo tee /etc/apt/sources.list < Date: Sun, 10 Sep 2017 13:26:45 +0200 Subject: [PATCH 08/18] tests: Ignore dbus-uuidgen error messages --- tests/end2end/fixtures/quteprocess.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 9c4f0fea8..ff7b987ed 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -66,6 +66,14 @@ def is_ignored_lowlevel_message(message): return True elif message == 'getrlimit(RLIMIT_NOFILE) failed': return True + # Travis CI containers don't have a /etc/machine-id + elif message.endswith('D-Bus library appears to be incorrectly set up; ' + 'failed to read machine uuid: Failed to open ' + '"/etc/machine-id": No such file or directory'): + return True + elif message == ('See the manual page for dbus-uuidgen to correct this ' + 'issue.'): + return True return False From 9e10f891ffcacd9cef26de1400b0a9792af578da Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 13:36:08 +0200 Subject: [PATCH 09/18] Print output earlier in test_version --- tests/end2end/test_invocations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index d1f4d0e23..ff6e110d7 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -176,14 +176,15 @@ def test_version(request): ok = proc.waitForStarted(2000) assert ok ok = proc.waitForFinished(2000) - assert ok - assert proc.exitStatus() == QProcess.NormalExit stdout = bytes(proc.readAllStandardOutput()).decode('utf-8') print(stdout) stderr = bytes(proc.readAllStandardError()).decode('utf-8') print(stderr) + assert ok + assert proc.exitStatus() == QProcess.NormalExit + assert re.search(r'^qutebrowser\s+v\d+(\.\d+)', stdout) is not None From 37464c8e3a6fe939b00716ac6d2b3b9b04002251 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 14:25:13 +0200 Subject: [PATCH 10/18] travis: Re-add installing eslint to travis_install --- scripts/dev/ci/travis_install.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index f5884d4ac..0ecf1028a 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -53,6 +53,12 @@ pip_install() { travis_retry python -m pip install "$@" } +npm_install() { + # Make sure npm is up-to-date first + travis_retry npm install -g npm + travis_retry npm install -g "$@" +} + check_pyqt() { python3 < Date: Sun, 10 Sep 2017 14:27:34 +0200 Subject: [PATCH 11/18] travis: Use Python 3.6 everywhere --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9de7fd9c..a471c8ad2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ sudo: false dist: trusty language: python group: edge +python: 3.6 matrix: include: @@ -18,16 +19,13 @@ matrix: env: DOCKER=ubuntu-xenial services: docker - os: linux - python: 3.6 env: TESTENV=py36-pyqt571 - os: linux - python: 3.6 env: TESTENV=py36-pyqt58 - os: linux python: 3.5 env: TESTENV=py35-pyqt59 - os: linux - python: 3.6 env: TESTENV=py36-pyqt59-cov - os: osx env: TESTENV=py36 OSX=elcapitan @@ -38,7 +36,6 @@ matrix: # osx_image: xcode6.4 - os: linux env: TESTENV=pylint PYTHON=python3.6 - python: 3.6 - os: linux env: TESTENV=flake8 - os: linux From f320da07b49fcec41c7d44b7f88c8f5173c5d33f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 14:28:42 +0200 Subject: [PATCH 12/18] Increase timeout for test_version --- tests/end2end/test_invocations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index ff6e110d7..4a416a752 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -175,7 +175,7 @@ def test_version(request): proc.start(sys.executable, args) ok = proc.waitForStarted(2000) assert ok - ok = proc.waitForFinished(2000) + ok = proc.waitForFinished(10000) stdout = bytes(proc.readAllStandardOutput()).decode('utf-8') print(stdout) From 4794d1970bfe26428bfc10aaa0b44898320b7f16 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 15:14:17 +0200 Subject: [PATCH 13/18] travis: Update macOS --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a471c8ad2..283eb9e78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,9 @@ matrix: - os: linux env: TESTENV=py36-pyqt59-cov - os: osx - env: TESTENV=py36 OSX=elcapitan - osx_image: xcode7.3 + env: TESTENV=py36 OSX=sierra + osx_image: xcode8.3 + language: generic # https://github.com/qutebrowser/qutebrowser/issues/2013 # - os: osx # env: TESTENV=py35 OSX=yosemite @@ -59,8 +60,6 @@ matrix: node_js: node allow_failures: - os: osx - env: TESTENV=py36 OSX=elcapitan - osx_image: xcode7.3 fast_finish: true cache: From c62e748b7b20b6b9429b3281242e1d6cdd20f4e9 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 10 Sep 2017 23:16:16 +0200 Subject: [PATCH 14/18] travis: Use Python 3 pip --- scripts/dev/ci/travis_install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/dev/ci/travis_install.sh b/scripts/dev/ci/travis_install.sh index 0ecf1028a..e18e1bad3 100644 --- a/scripts/dev/ci/travis_install.sh +++ b/scripts/dev/ci/travis_install.sh @@ -49,8 +49,7 @@ brew_install() { } pip_install() { - # this uses python2 - travis_retry python -m pip install "$@" + travis_retry python3 -m pip install "$@" } npm_install() { @@ -87,7 +86,7 @@ elif [[ $TRAVIS_OS_NAME == osx ]]; then brew_install python3 qt5 pyqt5 pip_install -r misc/requirements/requirements-tox.txt - pip --version + python3 -m pip --version tox --version check_pyqt exit 0 From 2538fec0c56dc77f9a4b8aea4afe20d822e32aef Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 11 Sep 2017 08:34:44 +0200 Subject: [PATCH 15/18] Ignore Mach IPC message --- tests/end2end/fixtures/quteprocess.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index ff7b987ed..f1906c1e5 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -135,6 +135,11 @@ def is_ignored_chromium_message(line): # [5947:5947:0605/192837.856931:ERROR:render_process_impl.cc(112)] # WebFrame LEAKED 1 TIMES 'WebFrame LEAKED 1 TIMES', + + # macOS on Travis + # [5140:5379:0911/063441.239771:ERROR:mach_port_broker.mm(175)] + # Unknown process 5176 is sending Mach IPC messages! + 'Unknown process * is sending Mach IPC messages!', ] return any(testutils.pattern_match(pattern=pattern, value=message) for pattern in ignored_messages) From 50d43b06783ea5ec189b68bbd68558f6cf670162 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 11 Sep 2017 09:53:11 +0200 Subject: [PATCH 16/18] Fix some macOS testsuite issues --- tests/end2end/data/userscripts/stdinclose.py | 2 +- tests/end2end/features/yankpaste.feature | 1 - tests/end2end/fixtures/quteprocess.py | 7 +++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/end2end/data/userscripts/stdinclose.py b/tests/end2end/data/userscripts/stdinclose.py index fa0676f73..8862fe7ba 100755 --- a/tests/end2end/data/userscripts/stdinclose.py +++ b/tests/end2end/data/userscripts/stdinclose.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2017 Florian Bruhin (The Compiler) diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature index ba5b56ca7..836fec539 100644 --- a/tests/end2end/features/yankpaste.feature +++ b/tests/end2end/features/yankpaste.feature @@ -291,7 +291,6 @@ Feature: Yanking and pasting. # Compare Then the javascript message "textarea contents: onHello worlde two three four" should be logged - @qtwebengine_mac_xfail Scenario: Inserting text into a text field with undo When I set general -> log-javascript-console to info And I open data/paste_primary.html diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index f1906c1e5..57e2f6576 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -74,6 +74,13 @@ def is_ignored_lowlevel_message(message): elif message == ('See the manual page for dbus-uuidgen to correct this ' 'issue.'): return True + # Travis CI macOS: + # 2017-09-11 07:32:56.191 QtWebEngineProcess[5455:28501] Couldn't set + # selectedTextBackgroundColor from default () + + elif message.endswith("Couldn't set selectedTextBackgroundColor from " + "default ()"): + return True return False From a65d70820a81ae75dc6041350cc2e7731df949aa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 11 Sep 2017 16:54:39 +0200 Subject: [PATCH 17/18] Add macOS xfail for session completion test See #2956 --- tests/end2end/features/completion.feature | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/end2end/features/completion.feature b/tests/end2end/features/completion.feature index e93518199..4ee1d8415 100644 --- a/tests/end2end/features/completion.feature +++ b/tests/end2end/features/completion.feature @@ -50,6 +50,8 @@ Feature: Using completion When I run :set-cmd-text -s :bind X Then the completion model should be bind + # See #2956 + @qtwebengine_mac_xfail Scenario: Using session completion Given I open data/hello.txt And I run :session-save hello From 9b8c21cacec97ff4da984b03c9b915194f0bf1f7 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 11 Sep 2017 16:55:05 +0200 Subject: [PATCH 18/18] travis: Stop marking macOS as allowed to fail --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 283eb9e78..fd1705e40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,8 +58,6 @@ matrix: language: node_js python: null node_js: node - allow_failures: - - os: osx fast_finish: true cache: