Restrict testCreateEmptyDirNoPermissions to Unix (#44282) (#44297)

The test EmptyDirTaskTests#testCreateEmptyDirNoPermissions may fail on
Windows. However, the test is only meaningful for Unix permissions
structures, so we should assume a Unix-family OS and skip the test on
Windows.

Fixes #44064
This commit is contained in:
William Brafford 2019-07-16 01:48:12 -04:00 committed by Alpar Torok
parent 8d68d1f54d
commit 673c63bb00
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,8 @@ package org.elasticsearch.gradle;
import java.io.File;
import java.io.IOException;
import com.carrotsearch.randomizedtesting.RandomizedTest;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.elasticsearch.gradle.test.GradleUnitTestCase;
import org.gradle.api.Project;
import org.gradle.testfixtures.ProjectBuilder;
@ -49,6 +51,8 @@ public class EmptyDirTaskTests extends GradleUnitTestCase {
}
public void testCreateEmptyDirNoPermissions() throws Exception {
RandomizedTest.assumeFalse("Functionality is Unix specific", Os.isFamily(Os.FAMILY_WINDOWS));
Project project = ProjectBuilder.builder().build();
EmptyDirTask emptyDirTask = project.getTasks().create("emptyDirTask", EmptyDirTask.class);
emptyDirTask.setDirMode(0000);