From 3b680d0bffc2553bbaf725f31670f4698b159adf Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 20 Nov 2017 13:54:52 +0100 Subject: [PATCH] Pass --disable-seccomp-filter-sandbox for tests with Qt 5.7.1 This is a stop-gap so I'm able to run end2end tests at least. See #3163. For unit tests, we need https://github.com/pytest-dev/pytest-qt/pull/193 first. --- tests/end2end/fixtures/quteprocess.py | 12 ++++++++---- tests/end2end/test_invocations.py | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index a2bbd81fd..cb9265910 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -33,7 +33,7 @@ import json import yaml import pytest -from PyQt5.QtCore import pyqtSignal, QUrl +from PyQt5.QtCore import pyqtSignal, QUrl, qVersion from qutebrowser.misc import ipc from qutebrowser.utils import log, utils, javascript @@ -422,10 +422,14 @@ class QuteProc(testprocess.Process): def _default_args(self): backend = 'webengine' if self.request.config.webengine else 'webkit' - return ['--debug', '--no-err-windows', '--temp-basedir', + args = ['--debug', '--no-err-windows', '--temp-basedir', '--json-logging', '--loglevel', 'vdebug', - '--backend', backend, '--debug-flag', 'no-sql-history', - 'about:blank'] + '--backend', backend, '--debug-flag', 'no-sql-history'] + if qVersion() == '5.7.1': + # https://github.com/qutebrowser/qutebrowser/issues/3163 + args += ['--qt-flag', 'disable-seccomp-filter-sandbox'] + args.append('about:blank') + return args def path_to_url(self, path, *, port=None, https=False): """Get a URL based on a filename for the localhost webserver. diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index c30768ddb..dc9486142 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -27,7 +27,7 @@ import re import pytest -from PyQt5.QtCore import QProcess +from PyQt5.QtCore import QProcess, qVersion def _base_args(config): @@ -37,6 +37,9 @@ def _base_args(config): args += ['--backend', 'webengine'] else: args += ['--backend', 'webkit'] + if qVersion() == '5.7.1': + # https://github.com/qutebrowser/qutebrowser/issues/3163 + args += ['--qt-flag', 'disable-seccomp-filter-sandbox'] args.append('about:blank') return args