janhoy commented on code in PR #5369:
URL: https://github.com/apache/solr/pull/5369#discussion_r4692472287


##########
solr/packaging/src/test/org/apache/solr/shell/ModulesTest.java:
##########
@@ -60,32 +58,15 @@ public void icuCollationInAnalysisExtrasModule() {
 
     env("SOLR_INCLUDE", solrIncludeFile.toString());
     run("solr start");
-    run("solr create -c COLL_NAME -d \"" + analysisExtrasConf() + "\"")
+    copyResource(

Review Comment:
   Done in 4f20c85935d: added a one-argument `copyResource(String)` that copies 
to the same relative path, and used it here and in `ExtractionTest`. I kept the 
name `copyResource`, since every DSL method is a CATS method already.



##########
solr/packaging/build.gradle:
##########
@@ -260,110 +257,17 @@ tasks.register('runDev', JavaExec) {
   args((project.findProperty('args') ?: '--module=http').split())
 }
 
-tasks.register('downloadBats') {
-  group = 'Build Dependency Download'
-  description =
-      'Downloads BATS and its helper libraries (bats-support, bats-assert, 
bats-file) used by integrationTests'
-
-  def batsLibs = [
-      [org: 'bats-core', repo: 'bats-core', version: 
libs.versions.bats.core.get()],
-      [org: 'ztombol', repo: 'bats-support', version: 
libs.versions.bats.support.get()],
-      [org: 'bats-core', repo: 'bats-assert', version: 
libs.versions.bats.assert.get()],
-      [org: 'bats-core', repo: 'bats-file', version: 
libs.versions.bats.file.get()],
-  ]
-  def downloadDir = file("$buildDir/bats-downloads")
-
-  inputs.property('batsLibs', batsLibs)
-  outputs.dir(batsLibsDir)
-
-  doLast {
-    delete batsLibsDir
-    mkdir downloadDir
-    batsLibs.each {lib ->
-      def archiveUrl = 
"https://github.com/${lib.org}/${lib.repo}/archive/refs/tags/v${lib.version}.tar.gz";
-      def archiveFile = new File(downloadDir, 
"${lib.repo}-${lib.version}.tar.gz")
-      ant.get(src: archiveUrl, dest: archiveFile, skipexisting: true)
-      copy {
-        from(tarTree(resources.gzip(archiveFile))) {
-          // Strip the leading "<repo>-<version>/" directory that GitHub's 
archive adds.
-          eachFile {details -> details.path = 
details.path.substring(details.path.indexOf('/') + 1)}
-          includeEmptyDirs = false
-        }
-        into "$batsLibsDir/${lib.repo}"
-      }
-    }
-  }
-}
-
-// Shared configuration for the BATS suites. outputName keeps each suite's 
Solr home, logs and
-// reports apart; usePicocli selects the experimental CLI implementation for 
the run.
-def configureBatsTask(BatsTask task, String outputName, boolean usePicocli) {
-  task.dependsOn installFullDist
-  task.dependsOn downloadBats
-
-  def integrationTestOutput = "$buildDir/$outputName"
-  def solrHome = "$integrationTestOutput/solr-home"
-  def solrTestFailuresDir = "$integrationTestOutput/failure-snapshots"
-  var solrPort = Integer
-      .parseInt((String) project.findProperty('bats.port') ?: 
System.getProperty("bats.port", "-1"))
-  while (solrPort > 64000 || solrPort < 0) { // We need room for +1000 for ZK
-    try (ServerSocket s = new ServerSocket(0)) {
-      solrPort = s.getLocalPort()
-    } catch (Exception e) {
-      println("WARN: Could not assign random port for Bats tests. Using 
default port 8983.")
-      solrPort = 8983
-    }
-  }
-
-  if (!Boolean.parseBoolean((String) 
project.findProperty('solr.bats.nightly'))) {
-    task.filterTags = '!nightly'
-  }
-
-  task.reportDir = integrationTestOutput
-  task.inputs.dir(distDir)
-  task.inputs.dir('test')  // Track .bats test files and helper as inputs
-  task.outputs.dir(integrationTestOutput)
-
-  task.doFirst {
-    delete integrationTestOutput
-    mkdir integrationTestOutput
-    mkdir solrHome
-    mkdir solrTestFailuresDir
-
-    // TODO - if quiet then don't tee
-    task.standardOutput = new TeeOutputStream(System.out,
-        new FileOutputStream("$integrationTestOutput/test-output.txt"))
-    println("Running BATS tests with Solr base port ${solrPort}")
-  }
-
-  task.environment SOLR_TIP: distDir.toString()
-  task.environment SOLR_HOME: solrHome
-  task.environment SOLR_PID_DIR: solrHome
-  task.environment SOLR_PORT_LISTEN: solrPort
-  task.environment SOLR_PORT: solrPort
-  task.environment SOLR2_PORT: solrPort + 1
-  task.environment SOLR3_PORT: solrPort + 2
-  task.environment ZK_PORT: solrPort + 1000
-  task.environment SOLR_LOGS_DIR: "$solrHome/logs"
-  task.environment TEST_OUTPUT_DIR: integrationTestOutput
-  task.environment TEST_FAILURE_DIR: solrTestFailuresDir
-  task.environment BATS_LIB_PREFIX: batsLibsDir
-  if (!usePicocli) {
-    task.environment SOLR_PICOCLI: 'false'
-  }
-}
-
 // CATS - Cross-platform Automated Testing System - the CLI suites built on the
 // org.apache.solr.cats harness and its Solr layer org.apache.solr.shell, both 
in
-// solr/test-framework. Like the BATS suites these need the
-// unpacked distribution, so they are not part of 'check' and the stock 'test' 
task is turned off.
+// solr/test-framework. They need the unpacked distribution, so they are not 
part of 'check' and
+// the stock 'test' task is turned off.
 tasks.named('test') {
   enabled = false
 }
 
-// Shared configuration for the CATS suites, mirroring configureBatsTask. 
outputName keeps
-// each variant's SOLR_HOMEs, port-block counter and failure snapshots apart; 
picocli selects the
-// CLI implementation, or null to take whatever bin/solr defaults to.
+// Shared configuration for the CATS suites. outputName keeps each variant's 
SOLR_HOMEs, port-block
+// counter and failure snapshots apart; picocli selects the CLI 
implementation, or null to take

Review Comment:
   `picocli` there is the method parameter, not the library: it sets 
`SOLR_PICOCLI`, and null keeps bin/solr's own default, so it does not default 
to picocli. Reworded in a0c22a11484 to make that clear.



-- 
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