Skip to content

Commit

Permalink
Merge pull request #71 from palantir/feature/remove-volumes-after-on-…
Browse files Browse the repository at this point in the history
…after

Remove volumes as part of the rm command
  • Loading branch information
hpryce committed May 27, 2016
2 parents d2bda3e + 3fc231a commit d72af71
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class DockerCompositionTest {
}
```

This will cause the containers defined in `src/test/resources/docker-compose.yml` to be started by Docker Compose before the test executes and then the containers will be killed once the test has finished executing.
This will cause the containers defined in `src/test/resources/docker-compose.yml` to be started by Docker Compose before the test executes and then the containers will be killed and removed (along with associated volumes) once the test has finished executing.

The `docker-compose.yml` file is referenced using the path given, relative to the working directory of the test. It will not be copied elsewhere and so references to shared directories and other resources for your containers can be made using path relative to this file as normal. If you wish to manually run the Docker containers for debugging the tests simply run `docker-compose up` in the same directory as the `docker-compose.yml`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void kill() throws IOException, InterruptedException {

@Override
public void rm() throws IOException, InterruptedException {
executeDockerComposeCommand(throwingOnError(), "rm", "-f");
executeDockerComposeCommand(throwingOnError(), "rm", "--force", "-v");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public void up_calls_docker_compose_up_with_daemon_flag() throws IOException, In
}

@Test
public void rm_calls_docker_compose_rm_with_f_flag() throws IOException, InterruptedException {
public void rm_calls_docker_compose_rm_with_force_and_volume_flags() throws IOException, InterruptedException {
compose.rm();
verify(executor).execute("rm", "-f");
verify(executor).execute("rm", "--force", "-v");
}

@Test
Expand Down

0 comments on commit d72af71

Please sign in to comment.