Clean up end2end test file structure

This renames tests/integration to tests/end2end and moves some files to
tests/end2end/fixtures.
This commit is contained in:
Florian Bruhin 2016-05-29 18:20:00 +02:00
parent f10754fa77
commit 64d4c9f83e
154 changed files with 39 additions and 41 deletions

View File

@ -158,11 +158,11 @@ Examples:
# run only pytest tests which failed in last run:
tox -e py35 -- --lf
# run only the integration feature tests:
tox -e py35 -- tests/integration/features
# run only the end2end feature tests:
tox -e py35 -- tests/end2end/features
# 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)
tox -e py35-cov -- tests/unit/browser/test_webelem.py

View File

@ -11,7 +11,8 @@ markers =
not_frozen: Tests which can't be run if sys.frozen is True.
no_xvfb: Tests which can't be run with Xvfb.
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.
pyqt531_or_newer: Needs PyQt 5.3.1 or newer.
xfail_norun: xfail the test with out running it

View File

@ -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 = []

View File

@ -60,8 +60,8 @@ def get_build_exe_options():
httpbin_dir = os.path.dirname(httpbin.__file__)
opts['include_files'] += [
('tests/integration/data', 'integration/data'),
(os.path.join(httpbin_dir, 'templates'), 'integration/templates'),
('tests/end2end/data', 'end2end/data'),
(os.path.join(httpbin_dir, 'templates'), 'end2end/templates'),
]
opts['packages'].append('qutebrowser')
@ -72,11 +72,13 @@ def main():
base = 'Win32GUI' if sys.platform.startswith('win') else None
with temp_git_commit_file():
cx.setup(
executables=[cx.Executable('scripts/dev/run_frozen_tests.py',
targetName='run-frozen-tests'),
cx.Executable('tests/integration/webserver_sub.py',
targetName='webserver_sub'),
freeze.get_exe(base, target_name='qutebrowser')],
executables=[
cx.Executable('scripts/dev/run_frozen_tests.py',
targetName='run-frozen-tests'),
cx.Executable('tests/end2end/fixtures/webserver_sub.py',
targetName='webserver_sub'),
freeze.get_exe(base, target_name='qutebrowser')
],
options={'build_exe': get_build_exe_options()},
**setupcommon.setupdata
)

View File

@ -107,8 +107,8 @@ def pytest_collection_modifyitems(items):
os.path.commonprefix([__file__, item.module.__file__]))
module_root_dir = os.path.split(module_path)[0]
if module_root_dir == 'integration':
item.add_marker(pytest.mark.integration)
if module_root_dir == 'end2end':
item.add_marker(pytest.mark.end2end)
_apply_platform_markers(item)
if item.get_marker('xfail_norun'):
@ -118,7 +118,7 @@ def pytest_collection_modifyitems(items):
def pytest_ignore_collect(path):
"""Ignore BDD tests during collection if frozen."""
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'))

View File

@ -19,15 +19,15 @@
# pylint: disable=unused-import
"""Things needed for integration testing."""
"""Things needed for end2end testing."""
import os
import shutil
import pstats
from webserver import httpbin, httpbin_after_test, ssl_server
from quteprocess import quteproc_process, quteproc, quteproc_new
from testprocess import pytest_runtest_makereport
from end2end.fixtures.webserver import httpbin, httpbin_after_test, ssl_server
from end2end.fixtures.quteprocess import quteproc_process, quteproc, quteproc_new
from end2end.fixtures.testprocess import pytest_runtest_makereport
def pytest_configure(config):

View File

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 186 B

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 511 B

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -130,7 +130,7 @@ def run_command(quteproc, httpbin, command):
@bdd.when(bdd.parsers.parse("I execute the userscript {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
path.
@ -345,7 +345,7 @@ def check_header(quteproc, header, value):
def check_contents(quteproc, filename):
"""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)
path = os.path.join(utils.abs_datapath(),

Some files were not shown because too many files have changed in this diff Show More