Skip to content

Apache Lucene open-source search software

SOLR-5022: Make it possible to disable HDFS tests on ANT command line (so ASF Jenkins can use it). Windows is disabled by default, too.

Uwe Schindler2734af0c567d
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index 313a5d6c3c2..359212a0730 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -968,6 +968,7 @@
<propertyref prefix="tests.badapples" />
<propertyref prefix="tests.timeoutSuite" />
<propertyref prefix="tests.jettyConnector" />
+ <propertyref prefix="tests.disableHdfs" />
</syspropertyset>
<!-- Pass randomized settings to the forked JVM. -->
diff --git a/solr/common-build.xml b/solr/common-build.xml
index c42e22015cc..57cfaf35571 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -123,6 +123,12 @@
</sequential>
</macrodef>
+ <!-- we don't want to run HDFS tests on Windows, because they require Cygwin.
+ If you have Cygwin, you can override this property on command line: -->
+ <condition property="tests.disableHdfs" value="true">
+ <os family="windows"/>
+ </condition>
+
<target name="validate" depends="compile-tools">
</target>
diff --git a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java
index 3da83ea9700..ec22c699712 100644
--- a/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java
+++ b/solr/core/src/test/org/apache/solr/cloud/hdfs/HdfsTestUtil.java
@@ -7,7 +7,6 @@ import java.util.Locale;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.lucene.util.Constants;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.solr.SolrTestCaseJ4;
import org.junit.Assert;
@@ -34,9 +33,8 @@ public class HdfsTestUtil {
private static Locale savedLocale;
public static MiniDFSCluster setupClass(String dataDir) throws Exception {
- LuceneTestCase.assumeFalse("HDFS tests on Windows require Cygwin", Constants.WINDOWS);
- LuceneTestCase.assumeFalse("HDFS do not work well with FreeBSD blackhole setup", Constants.FREE_BSD);
- // LuceneTestCase.assumeFalse("HDFS tests on Windows require Cygwin", Constants.F);
+ LuceneTestCase.assumeFalse("HDFS tests were disabled by -Dtests.disableHdfs",
+ Boolean.parseBoolean(System.getProperty("tests.disableHdfs", "false")));
File dir = new File(dataDir);
new File(dataDir).mkdirs();