@@ -690,7 +690,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs):
690690 shutil .copytree (unpackPath , java11UnpackPath )
691691 os .chdir (java11UnpackPath )
692692 print (' test solr example w/ Java 11...' )
693- testSolrExample (java11UnpackPath , java .java11_home )
693+ testSolrExample (java11UnpackPath , java .java11_home , isSlim )
694694
695695 if java .run_java17 :
696696 print (' copying unpacked distribution for Java 17 ...' )
@@ -700,7 +700,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs):
700700 shutil .copytree (unpackPath , java17UnpackPath )
701701 os .chdir (java17UnpackPath )
702702 print (' test solr example w/ Java 17...' )
703- testSolrExample (java17UnpackPath , java .java17_home )
703+ testSolrExample (java17UnpackPath , java .java17_home , isSlim )
704704
705705 os .chdir (unpackPath )
706706
@@ -742,7 +742,7 @@ def is_port_in_use(port):
742742 with socket .socket (socket .AF_INET , socket .SOCK_STREAM ) as s :
743743 return s .connect_ex (('localhost' , port )) == 0
744744
745- def testSolrExample (binaryDistPath , javaPath ):
745+ def testSolrExample (binaryDistPath , javaPath , isSlim ):
746746 # test solr using some examples it comes with
747747 logFile = '%s/solr-example.log' % binaryDistPath
748748 old_cwd = os .getcwd () # So we can back-track
@@ -754,6 +754,10 @@ def testSolrExample(binaryDistPath, javaPath):
754754 env ['JAVA_HOME' ] = javaPath
755755 env ['PATH' ] = '%s/bin:%s' % (javaPath , env ['PATH' ])
756756
757+ example = "techproducts"
758+ if isSlim :
759+ example = "films"
760+
757761 # Stop Solr running on port 8983 (in case a previous run didn't shutdown cleanly)
758762 try :
759763 if not cygwin :
@@ -763,20 +767,20 @@ def testSolrExample(binaryDistPath, javaPath):
763767 except :
764768 print (' Stop failed due to: ' + sys .exc_info ()[0 ])
765769
766- print (' Running techproducts example on port 8983 from %s' % binaryDistPath )
770+ print (' Running %s example on port 8983 from %s' % ( example , binaryDistPath ) )
767771 try :
768772 if not cygwin :
769- runExampleStatus = subprocess .call (['bin/solr' ,'start' ,'-e' ,'techproducts' ])
773+ runExampleStatus = subprocess .call (['bin/solr' ,'start' ,'-e' ,example ])
770774 else :
771- runExampleStatus = subprocess .call ('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd -e techproducts' , shell = True )
775+ runExampleStatus = subprocess .call ('env "PATH=`cygpath -S -w`:$PATH" bin/solr.cmd -e ' + example , shell = True )
772776
773777 if runExampleStatus != 0 :
774- raise RuntimeError ('Failed to run the techproducts example, check log for previous errors.' )
778+ raise RuntimeError ('Failed to run the %s example, check log for previous errors.' % example )
775779
776780 os .chdir ('example' )
777781 print (' run query...' )
778- s = load ('http://localhost:8983/solr/techproducts /select/?q=video' )
779- if s .find ('"numFound":3,' ) == - 1 :
782+ s = load ('http://localhost:8983/solr/%s /select/?q=video' % example )
783+ if s .find ('"numFound":%d,' % ( 8 if isSlim else 3 ) ) == - 1 :
780784 print ('FAILED: response is:\n %s' % s )
781785 raise RuntimeError ('query on solr example instance failed' )
782786 s = load ('http://localhost:8983/api/cores' )
0 commit comments