Skip to content

Add BATS test for bootstrap_confdir and collection.configName system properties#12

Closed
Copilot wants to merge 13 commits intomainfrom
copilot/fix-7df2ce69-bc8a-4146-b0e1-f2e206772f13
Closed

Add BATS test for bootstrap_confdir and collection.configName system properties#12
Copilot wants to merge 13 commits intomainfrom
copilot/fix-7df2ce69-bc8a-4146-b0e1-f2e206772f13

Conversation

Copy link
Copy Markdown

Copilot AI commented Aug 26, 2025

This PR adds a new BATS integration test to verify the functionality of the bootstrap_confdir and collection.configName system properties that enable uploading custom configsets during Solr startup.

Background

Solr supports bootstrapping configsets at startup using system properties:

  • bootstrap_confdir: Specifies a directory of configuration files to upload
  • collection.configName: Names the uploaded configset (defaults to "configuration1")

By default, only the _default configset is uploaded. These properties allow users to upload additional configsets like sample_techproducts_configs during startup without manual intervention.

Changes

Added a new test bootstrap configset using bootstrap_confdir and collection.configName to solr/packaging/test/test_start_solr.bats that:

  1. Verifies the source exists: Confirms the sample_techproducts_configs/conf directory is present
  2. Starts Solr with bootstrap properties: Uses -Dbootstrap_confdir pointing to the techproducts config directory and -Dcollection.configName=techproducts to name it
  3. Validates startup: Ensures Solr starts successfully
  4. Confirms upload: Uses the existing config_exists helper to verify the "techproducts" configset was uploaded to ZooKeeper

Test Validation

The test follows established patterns from existing BATS tests:

  • Uses the same SOLR_TIP environment variable for path resolution
  • Follows the pattern of solr startsolr assert --started → verification
  • Uses the existing config_exists helper function (similar to test_zk.bats)
  • Includes proper timing with sleep 1 to allow upload completion

Usage Example

When the test runs, it effectively executes:

solr start -Dbootstrap_confdir="/path/to/solr/server/solr/configsets/sample_techproducts_configs/conf" -Dcollection.configName=techproducts

This uploads the techproducts configuration as a configset named "techproducts" that can be used for creating collections.

The test can be run with: ./gradlew :solr:packaging:integrationTests --tests "test_start_solr.bats"

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-21-jdk-amd64/bin/java -XX:ReservedCodeCacheSize=256m -XX:TieredStopAtLevel=1 -XX:+UseParallelGC -XX:ActiveProcessorCount=1 --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2g -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/home/REDACTED/work/solr/solr/.gradle/tmp -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.10-bin/deqhafrv1ntovfmgh0nh3npr9/gradle-8.10/lib/gradle-daemon-main-8.10.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.10-bin/deqhafrv1ntovfmgh0nh3npr9/gradle-8.10/lib/agents/gradle-instrumentation-agent-8.10.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.10 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits August 26, 2025 10:04
…properties

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
…ducts configset

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Copilot AI changed the title [WIP] I would like a BATS test added to test_start_solr.bats that verifies the two system variables bootstrap_confdir and bootstrap_conf work. They are used to upload a config that Solr has but that which isn't uploaded by default (and only _default is by d... Add BATS test for bootstrap_confdir and collection.configName system properties Aug 26, 2025
Copilot AI requested a review from epugh August 26, 2025 10:11
@github-actions github-actions bot added the tests label Aug 27, 2025
@epugh epugh closed this Sep 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment