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

Give tests access to inner Docker container if truly necessary #877

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

public abstract class DockerContainerManagedResource implements ManagedResource {

public static final String DOCKER_INNER_CONTAINER = DockerContainerManagedResource.class.getName() + "_inner";
private static final String DELETE_IMAGE_ON_STOP_PROPERTY = "container.delete.image.on.stop";
private static final String TARGET = "target";

Expand Down Expand Up @@ -66,6 +67,8 @@ public void start() {
loggingHandler.startWatching();

doStart();

context.put(DOCKER_INNER_CONTAINER, innerContainer);
}

private boolean isDockerImageDeletedOnStop() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public Path getServiceFolder() {
return context.getServiceFolder();
}

protected <U> U getPropertyFromContext(String key) {
public <U> U getPropertyFromContext(String key) {
if (context == null) {
fail("Service has not been initialized yet. Make sure you invoke this method in the right order.");
}
Expand Down
Loading