Fix logic in dockerComposeSupported (#36125)

The logic in the dockerComposeSupported method currently returns false
even when docker and docker compose are available on the build machine.
This change updates the check to see if docker compose is available in
one of the two paths and allows the `tests.fixture.enabled` property to
disable the tests even if docker compose is available.
This commit is contained in:
Jay Modi 2018-11-30 14:38:10 -07:00 committed by GitHub
parent 98b290637d
commit 7b999bdc88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -103,10 +103,9 @@ public class TestFixturesPlugin implements Plugin<Project> {
@Input
public boolean dockerComposeSupported(Project project) {
// Don't look for docker-compose on the PATH yet that would pick up on Windows as well
return
project.file("/usr/local/bin/docker-compose").exists() == false &&
project.file("/usr/bin/docker-compose").exists() == false &&
Boolean.parseBoolean(System.getProperty("tests.fixture.enabled", "true")) == false;
final boolean hasDockerCompose = project.file("/usr/local/bin/docker-compose").exists() ||
project.file("/usr/bin/docker-compose").exists();
return hasDockerCompose && Boolean.parseBoolean(System.getProperty("tests.fixture.enabled", "true"));
}
private void setSystemProperty(Task task, String name, Object value) {