br4chu / docker-compose-maven-plugin

Maven plugin that talks to docker-compose command-line interface
Apache License 2.0
12 stars 4 forks source link

Compose remain running in case of Junit Tests failures #11

Closed MarcoMontel closed 2 years ago

MarcoMontel commented 3 years ago

Assuming this configuration

        <plugin>
            <groupId>io.brachu</groupId>
            <artifactId>docker-compose-maven-plugin</artifactId>
            <version>0.9.0</version>
            <executions>
                <execution>
                    <id>clean-before-up</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>down</goal>
                    </goals>
                </execution>
                <execution>
                    <id>up</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>up</goal>
                    </goals>
                </execution>
                <execution>
                    <id>down</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>down</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

The down goal seems not to work properly because it is not able to handle the fact that at first execution the cluster is not running.

Execution clean-before-up of goal io.brachu:docker-compose-maven-plugin:0.9.0:down failed: Cluster is not up -> [Help 1]

mjagus commented 2 years ago

This is now fixed in v0.11.0. As a workaround for older versions, one can disable killBeforeDown property of down goal.