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

Traverse directories up to find docker-compose.yml file #63

Open
Toilal opened this issue Sep 11, 2020 · 1 comment · May be fixed by #64
Open

Traverse directories up to find docker-compose.yml file #63

Toilal opened this issue Sep 11, 2020 · 1 comment · May be fixed by #64

Comments

@Toilal
Copy link

Toilal commented Sep 11, 2020

By default, it would be convenient to make this plugin traverse directories up from the current working directory to find docker-compose.yml configuration, instead of using the current working directory only.

It will then be possible to use different docker-compose.yml configuration only by organizing the configurations inside many directories.

|- it1/
    |- docker-compose.yml
    |- foo1_test.py
    |- bar1_test.py
|- it2/
    |- docker-compose.yml
    |- foo2_test.py
    |- bar2_test.py

So foo1 and bar1 tests will use it1/docker-compose.yml, foo2 and bar2 will use it2/docker-compose.yml.

In fact, docker-compose itself use this behavior to find docker-compose.yml file. So when no --docker-compose option is given to pytest, it should invoke docker-compose with no --file flag at all instead of actual --file docker-compose.yml.

@Toilal
Copy link
Author

Toilal commented Sep 11, 2020

Actually docker_project fixture is session scoped.

@pytest.fixture(scope="session")

This would require to change the scope of this fixture.

This fixture could be change to a factory function that generates a new project each time.

Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Sep 11, 2020
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict that keeps all docker_project instances involved in the pytest session. At the same time, docker_project session scoped fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Sep 11, 2020
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict that keeps all docker_project instances involved in the pytest session. At the same time, docker_project session scoped fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Sep 11, 2020
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Sep 11, 2020
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Feb 10, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Feb 10, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Feb 10, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Feb 10, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Feb 10, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Feb 10, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Feb 10, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Toilal added a commit to Toilal/pytest-docker-compose that referenced this issue Oct 14, 2021
…ns inside test directory structure.

docker-compose configuration is now loaded from 3 directories:
 - Directory containing the actual test
 - "docker-compose" directory at the same level of the directory containing the actual test
 - Current working directory.

Effective directory is the first one in this list where docker-compose can run properly. Effective directory can be forced with --docker-compose-directory option.

All docker_project objects are now registered in all_docker_projects registry, a simple dict available as a session scoped fixture that keeps all docker_project instances involved in the pytest session. At the same time, docker_project fixture has been dropped. This change makes possible to have different docker_project instances for the run session, while still allowing to reuse the docker_project instance when the same configuration is involved.

ContainerGetter has been improved to wait for container to be in running state before returning. To retrieve a stopped service, user can use set wait_running argument to False. This changes makes tests more stable. (In my use case, network_info was often empty because it was retrieved when a container was still starting or restarting)

Some broken tests were fixed too.

I also tried to update CircleCI configuration to make it test with Python 3.7/3.8.

Close pytest-docker-compose#43
Close pytest-docker-compose#63

BREAKING CHANGE: --docker-compose option doesn't support "," separator anymore and should now be used many times to include many configuration files.
BREAKING CHANGE: docker_project fixture has been dropped, use all_docker_projects instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant