epugh commented on code in PR #3784:
URL: https://github.com/apache/solr/pull/3784#discussion_r2447597386


##########
solr/packaging/test/test_extraction.bats:
##########
@@ -32,79 +41,74 @@ teardown() {
 
 @test "using curl to extract a single pdf file" {
 
+  if [ -n "${DOCKER_UNAVAILABLE:-}" ]; then
+    echo "WARNING: Docker not available; bypassing test." >&3
+    return 0
+  fi
+
   # Disable security manager to allow extraction
   # This appears to be a bug.
   export SOLR_SECURITY_MANAGER_ENABLED=false
   solr start -Dsolr.modules=extraction
-  
-  
-  solr create -c gettingstarted -d _default
 
-  
-  curl -X POST -H 'Content-type:application/json' -d '{
-    "add-requesthandler": {
-      "name": "/update/extract",
-      "class": "solr.extraction.ExtractingRequestHandler",
-      "defaults":{ "lowernames": "true", "captureAttr":"true"}
-    }
-  }' "http://localhost:${SOLR_PORT}/solr/gettingstarted/config";
+  solr create -c gettingstarted -d _default
+  wait_for_collection gettingstarted 30
+  apply_extract_handler gettingstarted

Review Comment:
   i don't totally love this method.  A) it looks like a lot of bash code, 
which is probalby why you made it a method.  B) I haven't ever had issues with 
calling the config api, so hopefully we wouldn't need all the erro hnadling.   
c) I like seeing every curl/api interaction right in the bats test.  It helps 
me understand what is going on step by step.   
   
   A thought, can the method just live in test_extraction.bats?    
   
   Another one is wait_for_collection.   Should our bin/solr assert handle that 
use case versus a custom bash method>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to