Clean up end2end test file structure
This renames tests/integration to tests/end2end and moves some files to tests/end2end/fixtures.
@ -158,11 +158,11 @@ Examples:
|
|||||||
# run only pytest tests which failed in last run:
|
# run only pytest tests which failed in last run:
|
||||||
tox -e py35 -- --lf
|
tox -e py35 -- --lf
|
||||||
|
|
||||||
# run only the integration feature tests:
|
# run only the end2end feature tests:
|
||||||
tox -e py35 -- tests/integration/features
|
tox -e py35 -- tests/end2end/features
|
||||||
|
|
||||||
# run everything with undo in the generated name, based on the scenario text
|
# run everything with undo in the generated name, based on the scenario text
|
||||||
tox -e py35 -- tests/integration/features/test_tabs.py -k undo
|
tox -e py35 -- tests/end2end/features/test_tabs_bdd.py -k undo
|
||||||
|
|
||||||
# run coverage test for specific file (updates htmlcov/index.html)
|
# run coverage test for specific file (updates htmlcov/index.html)
|
||||||
tox -e py35-cov -- tests/unit/browser/test_webelem.py
|
tox -e py35-cov -- tests/unit/browser/test_webelem.py
|
||||||
|
@ -11,7 +11,8 @@ markers =
|
|||||||
not_frozen: Tests which can't be run if sys.frozen is True.
|
not_frozen: Tests which can't be run if sys.frozen is True.
|
||||||
no_xvfb: Tests which can't be run with Xvfb.
|
no_xvfb: Tests which can't be run with Xvfb.
|
||||||
frozen: Tests which can only be run if sys.frozen is True.
|
frozen: Tests which can only be run if sys.frozen is True.
|
||||||
integration: Tests which test a bigger portion of code, run without coverage.
|
integration: Tests which test a bigger portion of code
|
||||||
|
end2end: End to end tests which run qutebrowser as subprocess
|
||||||
skip: Always skipped test.
|
skip: Always skipped test.
|
||||||
pyqt531_or_newer: Needs PyQt 5.3.1 or newer.
|
pyqt531_or_newer: Needs PyQt 5.3.1 or newer.
|
||||||
xfail_norun: xfail the test with out running it
|
xfail_norun: xfail the test with out running it
|
||||||
|
@ -143,7 +143,7 @@ PERFECT_FILES = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# 100% coverage because of integration tests, but no perfect unit tests yet.
|
# 100% coverage because of end2end tests, but no perfect unit tests yet.
|
||||||
WHITELISTED_FILES = []
|
WHITELISTED_FILES = []
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ def get_build_exe_options():
|
|||||||
|
|
||||||
httpbin_dir = os.path.dirname(httpbin.__file__)
|
httpbin_dir = os.path.dirname(httpbin.__file__)
|
||||||
opts['include_files'] += [
|
opts['include_files'] += [
|
||||||
('tests/integration/data', 'integration/data'),
|
('tests/end2end/data', 'end2end/data'),
|
||||||
(os.path.join(httpbin_dir, 'templates'), 'integration/templates'),
|
(os.path.join(httpbin_dir, 'templates'), 'end2end/templates'),
|
||||||
]
|
]
|
||||||
|
|
||||||
opts['packages'].append('qutebrowser')
|
opts['packages'].append('qutebrowser')
|
||||||
@ -72,11 +72,13 @@ def main():
|
|||||||
base = 'Win32GUI' if sys.platform.startswith('win') else None
|
base = 'Win32GUI' if sys.platform.startswith('win') else None
|
||||||
with temp_git_commit_file():
|
with temp_git_commit_file():
|
||||||
cx.setup(
|
cx.setup(
|
||||||
executables=[cx.Executable('scripts/dev/run_frozen_tests.py',
|
executables=[
|
||||||
|
cx.Executable('scripts/dev/run_frozen_tests.py',
|
||||||
targetName='run-frozen-tests'),
|
targetName='run-frozen-tests'),
|
||||||
cx.Executable('tests/integration/webserver_sub.py',
|
cx.Executable('tests/end2end/fixtures/webserver_sub.py',
|
||||||
targetName='webserver_sub'),
|
targetName='webserver_sub'),
|
||||||
freeze.get_exe(base, target_name='qutebrowser')],
|
freeze.get_exe(base, target_name='qutebrowser')
|
||||||
|
],
|
||||||
options={'build_exe': get_build_exe_options()},
|
options={'build_exe': get_build_exe_options()},
|
||||||
**setupcommon.setupdata
|
**setupcommon.setupdata
|
||||||
)
|
)
|
||||||
|
@ -107,8 +107,8 @@ def pytest_collection_modifyitems(items):
|
|||||||
os.path.commonprefix([__file__, item.module.__file__]))
|
os.path.commonprefix([__file__, item.module.__file__]))
|
||||||
|
|
||||||
module_root_dir = os.path.split(module_path)[0]
|
module_root_dir = os.path.split(module_path)[0]
|
||||||
if module_root_dir == 'integration':
|
if module_root_dir == 'end2end':
|
||||||
item.add_marker(pytest.mark.integration)
|
item.add_marker(pytest.mark.end2end)
|
||||||
|
|
||||||
_apply_platform_markers(item)
|
_apply_platform_markers(item)
|
||||||
if item.get_marker('xfail_norun'):
|
if item.get_marker('xfail_norun'):
|
||||||
@ -118,7 +118,7 @@ def pytest_collection_modifyitems(items):
|
|||||||
def pytest_ignore_collect(path):
|
def pytest_ignore_collect(path):
|
||||||
"""Ignore BDD tests during collection if frozen."""
|
"""Ignore BDD tests during collection if frozen."""
|
||||||
rel_path = path.relto(os.path.dirname(__file__))
|
rel_path = path.relto(os.path.dirname(__file__))
|
||||||
return (rel_path == os.path.join('integration', 'features') and
|
return (rel_path == os.path.join('end2end', 'features') and
|
||||||
hasattr(sys, 'frozen'))
|
hasattr(sys, 'frozen'))
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,15 +19,15 @@
|
|||||||
|
|
||||||
# pylint: disable=unused-import
|
# pylint: disable=unused-import
|
||||||
|
|
||||||
"""Things needed for integration testing."""
|
"""Things needed for end2end testing."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import pstats
|
import pstats
|
||||||
|
|
||||||
from webserver import httpbin, httpbin_after_test, ssl_server
|
from end2end.fixtures.webserver import httpbin, httpbin_after_test, ssl_server
|
||||||
from quteprocess import quteproc_process, quteproc, quteproc_new
|
from end2end.fixtures.quteprocess import quteproc_process, quteproc, quteproc_new
|
||||||
from testprocess import pytest_runtest_makereport
|
from end2end.fixtures.testprocess import pytest_runtest_makereport
|
||||||
|
|
||||||
|
|
||||||
def pytest_configure(config):
|
def pytest_configure(config):
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
@ -130,7 +130,7 @@ def run_command(quteproc, httpbin, command):
|
|||||||
|
|
||||||
@bdd.when(bdd.parsers.parse("I execute the userscript {userscript}"))
|
@bdd.when(bdd.parsers.parse("I execute the userscript {userscript}"))
|
||||||
def run_userscript(quteproc, userscript):
|
def run_userscript(quteproc, userscript):
|
||||||
"""Run a userscript located in tests/integration/data/userscripts.
|
"""Run a userscript located in tests/end2end/data/userscripts.
|
||||||
|
|
||||||
Wrapper around :spawn --userscript {userscript} that uses an absolute
|
Wrapper around :spawn --userscript {userscript} that uses an absolute
|
||||||
path.
|
path.
|
||||||
@ -345,7 +345,7 @@ def check_header(quteproc, header, value):
|
|||||||
def check_contents(quteproc, filename):
|
def check_contents(quteproc, filename):
|
||||||
"""Check the current page's content.
|
"""Check the current page's content.
|
||||||
|
|
||||||
The filename is interpreted relative to tests/integration/data.
|
The filename is interpreted relative to tests/end2end/data.
|
||||||
"""
|
"""
|
||||||
content = quteproc.get_content(plain=False)
|
content = quteproc.get_content(plain=False)
|
||||||
path = os.path.join(utils.abs_datapath(),
|
path = os.path.join(utils.abs_datapath(),
|