Skip to content

Commit b3be6d6

Browse files
committed
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.
1 parent 0d911a8 commit b3be6d6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/testfixtures/TestFixturesPlugin.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ public void apply(Project project) {
103103
@Input
104104
public boolean dockerComposeSupported(Project project) {
105105
// Don't look for docker-compose on the PATH yet that would pick up on Windows as well
106-
return
107-
project.file("/usr/local/bin/docker-compose").exists() == false &&
108-
project.file("/usr/bin/docker-compose").exists() == false &&
109-
Boolean.parseBoolean(System.getProperty("tests.fixture.enabled", "true")) == false;
106+
final boolean hasDockerCompose = project.file("/usr/local/bin/docker-compose").exists() ||
107+
project.file("/usr/bin/docker-compose").exists();
108+
return hasDockerCompose && Boolean.parseBoolean(System.getProperty("tests.fixture.enabled", "true"));
110109
}
111110

112111
private void setSystemProperty(Task task, String name, Object value) {

0 commit comments

Comments
 (0)