Bug 1347483 - blessings package should not be downloaded during mach virtualenv setup; r=mshal

This fixes a regression introduced in Bug 1335873, which changes the mozbase
packages.txt to call mozlog's setup.py. Calling setup.py registers the
pytest_mozlog plugin for marionette-harness tests.

Instead, we can register the pytest-mozlog plugin via command-line arguments
to pytest, which are set in pytest.ini for the marionette-harness tests.
As a result, we can revert the mozbase packages.txt to not refer to mozlog's
setup.py

I'm leaving the pytest entry-point in mozlog's setup.py so that external
consumers don't have to register the pytest_mozlog plugin manually.

MozReview-Commit-ID: I5wNq5H1x3X

--HG--
extra : rebase_source : 614a47995bc1655f36053d2a05b08f94bfdbe476
This commit is contained in:
Maja Frydrychowicz 2017-03-22 14:26:18 -04:00
Родитель 8e37e1f8f4
Коммит dcf67352b6
9 изменённых файлов: 17 добавлений и 8 удалений

Просмотреть файл

@ -47,7 +47,9 @@ marionette-harness:
when:
files-changed:
- 'testing/marionette/harness/**'
- 'testing/mozbase/mozlog/mozlog/pytest_mozlog/**'
- 'testing/mozbase/mozlog/mozlog/**'
- 'testing/mozbase/mozlog/setup.py'
- 'testing/mozbase/packages.txt'
- 'python/mach_commands.py'
mozbase:

Просмотреть файл

@ -0,0 +1,7 @@
[pytest]
# Early-load pytest_mozlog plugin to replace terminal reporter.
# Adding pytest_mozlog plugin to conftest.py registers the plugin
# too late for tests to recognize mozlog options.
# This manual registration of plugin is needed for running these
# tests in mach, whose virtualenv setup does not call mozlog's setup.py
addopts = -p mozlog.pytest_mozlog.plugin -p no:terminalreporter

Просмотреть файл

@ -88,4 +88,4 @@ def test_handler(server):
if __name__ == "__main__":
import sys
sys.exit(pytest.main(
['-p', 'no:terminalreporter', '--log-tbpl=-', __file__]))
['--log-tbpl=-', __file__]))

Просмотреть файл

@ -30,4 +30,4 @@ def test_parse_arg_socket_timeout(socket_timeout):
if __name__ == '__main__':
import sys
sys.exit(pytest.main(
['-p', 'no:terminalreporter', '--log-tbpl=-', __file__]))
['--log-tbpl=-', __file__]))

Просмотреть файл

@ -106,4 +106,4 @@ def test_harness_sets_up_default_test_handlers(mach_parsed_kwargs):
if __name__ == '__main__':
import sys
sys.exit(pytest.main(
['-p', 'no:terminalreporter', '--log-tbpl=-', __file__]))
['--log-tbpl=-', __file__]))

Просмотреть файл

@ -440,4 +440,4 @@ def test_e10s_option_clash_raises(mock_runner):
if __name__ == '__main__':
import sys
sys.exit(pytest.main(
['-p', 'no:terminalreporter', '--log-tbpl=-', __file__]))
['--log-tbpl=-', __file__]))

Просмотреть файл

@ -52,4 +52,4 @@ def test_crash_is_recorded_as_error(empty_marionette_test,
if __name__ == '__main__':
import sys
sys.exit(pytest.main(
['-p', 'no:terminalreporter', '--log-tbpl=-', __file__]))
['--log-tbpl=-', __file__]))

Просмотреть файл

@ -65,4 +65,4 @@ def test_where_is():
if __name__ == "__main__":
import sys
sys.exit(pytest.main(
['-s', '-p', 'no:terminalreporter', '--log-tbpl=-', __file__]))
['--log-tbpl=-', __file__]))

Просмотреть файл

@ -8,7 +8,7 @@ mozhttpd.pth:testing/mozbase/mozhttpd
mozinfo.pth:testing/mozbase/mozinfo
mozinstall.pth:testing/mozbase/mozinstall
mozleak.pth:testing/mozbase/mozleak
setup.py:testing/mozbase/mozlog:develop
mozlog.pth:testing/mozbase/mozlog
moznetwork.pth:testing/mozbase/moznetwork
mozprocess.pth:testing/mozbase/mozprocess
mozprofile.pth:testing/mozbase/mozprofile