You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2020/06/05 18:50:19 UTC

[lucene-solr] branch branch_8x updated: Assume the 'javascript' engine is supported before trying test, to prevent spurious failures on systems w/o javascript engine

This is an automated email from the ASF dual-hosted git repository.

hossman pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 83444b2  Assume the 'javascript' engine is supported before trying test, to prevent spurious failures on systems w/o javascript engine
83444b2 is described below

commit 83444b220fca07d40101e6fe9a5066c920b41803
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Fri Jun 5 11:39:08 2020 -0700

    Assume the 'javascript' engine is supported before trying test, to prevent spurious failures on systems w/o javascript engine
    
    (cherry picked from commit 924e7d5cd6e29fb736fb462e09fd0a1a05a7649a)
---
 solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
index baf3c57..666e142 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPI.java
@@ -39,6 +39,7 @@ import java.util.Properties;
 import java.util.Set;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
+import javax.script.ScriptEngineManager;
 
 import com.google.common.collect.ImmutableMap;
 import org.apache.commons.io.FileUtils;
@@ -83,6 +84,7 @@ import org.apache.solr.util.ExternalPaths;
 import org.apache.zookeeper.CreateMode;
 import org.apache.zookeeper.KeeperException;
 import org.junit.After;
+import org.junit.Assume;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -344,6 +346,9 @@ public class TestConfigSetsAPI extends SolrTestCaseJ4 {
   
   @Test
   public void testUploadWithScriptUpdateProcessor() throws Exception {
+    Assume.assumeNotNull((new ScriptEngineManager()).getEngineByExtension("js"));
+    Assume.assumeNotNull((new ScriptEngineManager()).getEngineByName("JavaScript"));
+    
       // Authorization off
       // unprotectConfigsHandler(); // TODO Enable this back when testUploadWithLibDirective() is re-enabled
       final String untrustedSuffix = "-untrusted";