Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate rsync support #828

Merged
merged 2 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Features
* ``--looponfail``: run your tests repeatedly in a subprocess. After each run
pytest waits until a file in your project changes and then re-runs
the previously failing tests. This is repeated until all tests pass
after which again a full run is performed.
after which again a full run is performed (DEPRECATED).

* :ref:`Multi-Platform` coverage: you can specify different Python interpreters
or different platforms and run tests in parallel on all of them.
Expand Down
11 changes: 11 additions & 0 deletions docs/remote.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@
Sending tests to remote SSH accounts
====================================

.. deprecated:: 3.0

.. warning::

This feature is deprecated because the support for ``rsync`` is faulty
in terms of reproducing the development environment in the remote
worker, and there is no clear solution moving forward.

This feature is scheduled to be removed in release 4.0, to let the team
focus on a smaller set of features.

Suppose you have a package ``mypkg`` which contains some
tests that you can successfully run locally. And you
have a ssh-reachable machine ``myhost``. Then
Expand Down
2 changes: 1 addition & 1 deletion src/xdist/looponfail.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def pytest_cmdline_main(config):
return 2 # looponfail only can get stop with ctrl-C anyway


def looponfail_main(config: pytest.Config) -> None:
def looponfail_main(config: "pytest.Config") -> None:
remotecontrol = RemoteControl(config)
config_roots = config.getini("looponfailroots")
if not config_roots:
Expand Down
8 changes: 6 additions & 2 deletions src/xdist/newhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ def pytest_xdist_newgateway(gateway):
"""called on new raw gateway creation."""


@pytest.hookspec()
@pytest.hookspec(
warn_on_impl="rsync feature is deprecated and will be removed in pytest-xdist 4.0"
)
def pytest_xdist_rsyncstart(source, gateways):
"""called before rsyncing a directory to remote gateways takes place."""


@pytest.hookspec()
@pytest.hookspec(
warn_on_impl="rsync feature is deprecated and will be removed in pytest-xdist 4.0"
)
def pytest_xdist_rsyncfinish(source, gateways):
"""called after rsyncing a directory to remote gateways takes place."""

Expand Down
7 changes: 7 additions & 0 deletions src/xdist/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ def pytest_configure(config):
)
config.issue_config_time_warning(warning, 2)

if config.getoption("rsyncdir", None) or config.getini("rsyncdirs"):
warning = DeprecationWarning(
"The --rsyncdir command line argument and rsyncdirs config variable are deprecated.\n"
"The rsync feature will be removed in pytest-xdist 4.0."
)
config.issue_config_time_warning(warning, 2)

config_line = (
"xdist_group: specify group for tests should run in same session."
"in relation to one another. " + "Provided by pytest-xdist."
Expand Down