Coder Social home page Coder Social logo

Comments (4)

edinhodiluviano avatar edinhodiluviano commented on July 30, 2024 4

I see no problem on the behavior of the library. The library already work as I need.
My only concern is the documentation.

from pytest-docker.

edinhodiluviano avatar edinhodiluviano commented on July 30, 2024 2

Hum... I'm not sure how it works on the docker-compose side. But pytest-docker already supports multiple files. It is just not documented.
The bellow example would work only with pytest-docker installed:

# test.py

import pytest


@pytest.fixture(scope="session")
def docker_compose_file(pytestconfig):
    return ("docker-compose-1.yml", "docker-compose-2.yml")  # here we define all compose files needed


@pytest.fixture(scope="module")
def containers(docker_services):
    docker_services.wait_until_responsive(
        timeout=30.0,
        pause=0.5,
        check=lambda: True,
    )


def test_dumb(containers):
    assert 1 == 1
# docker-compose-1.yml

version: "3"

services:
    container_1:
        image: python:3.9
        container_name: container_1
        command: ["python", "--version"]
# docker-compose-2.yml

services:
    container_2:
        image: python:3.9
        container_name: container_2
        command: ["python", "--version"]

Just run pytest test.py and for a while you will be able to see both containers running, started by pytest-docker.
I was using it in a bigger project with multiple files for integration and migration tests and it was working fine.

from pytest-docker.

Luminaar avatar Luminaar commented on July 30, 2024

Hello. pytest-docker currently uses docker-compose v1. The feature you linked is available in docker-compose v2. This new version is not written in Python and so it's not possible to install it together with this library.

Support for a docker-compose v2 would require a major change to this library ― requiring users to provide their own installation of docker-compose or maybe allowing both.

I will try looking into this but please understand that it might take some time.

from pytest-docker.

n1ngu avatar n1ngu commented on July 30, 2024

This new version is not written in Python and so it's not possible to install it together with this library.

Support for a docker-compose v2 would require a major change to this library ― requiring users to provide their own installation of docker-compose or maybe allowing both.

@Luminaar AFAIU, as long as the shell environment is configured in a way that the subprocess.check_output('docker-compose ...') finds the v2 installation, wouldn't everything work out of the box?

Obviously docker-compose v2 can't be installed as a python dependency anymore, but maybe this is what @edinhodiluviano is observing?

from pytest-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.