mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Revert "testing: fixtures: fix docker regression"
This reverts commit b80d84e689.
This commit is contained in:
+1
-13
@@ -219,12 +219,7 @@ def docker_compose_project_name():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def docker_services(
|
def docker_services(request, tmp_path_factory):
|
||||||
request,
|
|
||||||
tmp_path_factory,
|
|
||||||
docker_compose_file,
|
|
||||||
docker_compose_project_name,
|
|
||||||
):
|
|
||||||
if os.environ.get("CI") and os.name == "nt":
|
if os.environ.get("CI") and os.name == "nt":
|
||||||
pytest.skip("disabled for Windows on CI")
|
pytest.skip("disabled for Windows on CI")
|
||||||
|
|
||||||
@@ -243,16 +238,9 @@ def docker_services(
|
|||||||
|
|
||||||
from filelock import FileLock
|
from filelock import FileLock
|
||||||
|
|
||||||
# pylint: disable-next=import-error
|
|
||||||
from pytest_docker.plugin import DockerComposeExecutor, Services
|
|
||||||
|
|
||||||
executor = DockerComposeExecutor(docker_compose_file, docker_compose_project_name)
|
|
||||||
|
|
||||||
# making sure we don't accidentally launch docker-compose in parallel,
|
# making sure we don't accidentally launch docker-compose in parallel,
|
||||||
# as it might result in network conflicts. Inspired by:
|
# as it might result in network conflicts. Inspired by:
|
||||||
# https://pytest-xdist.readthedocs.io/en/stable/how-to.html#making-session-scoped-fixtures-execute-only-once
|
# https://pytest-xdist.readthedocs.io/en/stable/how-to.html#making-session-scoped-fixtures-execute-only-once
|
||||||
root = tmp_path_factory.getbasetemp().parent
|
root = tmp_path_factory.getbasetemp().parent
|
||||||
with FileLock(os.fspath(root / "docker-compose.lock")):
|
with FileLock(os.fspath(root / "docker-compose.lock")):
|
||||||
yield request.getfixturevalue("docker_services")
|
yield request.getfixturevalue("docker_services")
|
||||||
|
|
||||||
return Services(executor)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user