Skip to content

Commit ef1bac0

Browse files
test: make Solr version configurable for compatibility testing (#50)
1 parent 1f4eca2 commit ef1bac0

5 files changed

Lines changed: 27 additions & 3 deletions

File tree

AGENTS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,27 @@ Spring Boot Buildpacks output logs to stdout, breaking MCP's STDIO protocol. Jib
7373
- **Integration tests** (`*IntegrationTest.java`, `*DirectTest.java`): Real Solr via Testcontainers
7474
- **Docker tests** (`containerization/`): Tagged `@Tag("docker-integration")`, run separately
7575

76+
### Solr Version Compatibility Testing
77+
78+
The Solr Docker image used in tests is configurable via the `solr.test.image` system property (default: `solr:9.9-slim`):
79+
80+
```bash
81+
./gradlew test -Dsolr.test.image=solr:8.11-slim # Solr 8.11
82+
./gradlew test -Dsolr.test.image=solr:9.4-slim # Solr 9.4
83+
./gradlew test -Dsolr.test.image=solr:9.9-slim # Solr 9.9 (default)
84+
```
85+
86+
**Tested compatible versions:** 8.11, 9.4, 9.9
87+
88+
### Solr 10 Compatibility Notes
89+
90+
Solr 10 introduces breaking changes that will require updates to this project:
91+
92+
- **MBeans removal:** `SolrInfoMBeanHandler` is removed. `CollectionService.getCollectionStats()` uses `/admin/mbeans` for cache and handler metrics — this will need to migrate to the `/admin/metrics` endpoint or OpenTelemetry.
93+
- **Metrics migration:** Dropwizard metrics replaced by OpenTelemetry. All metric names switch to snake_case. JMX, Prometheus exporter, SLF4J, and Graphite reporters are removed.
94+
- **SolrJ base URL:** SolrClient now only accepts root URLs (e.g., `http://host:8983/solr`). This project already uses root URLs with per-request collection names, so **no change needed** here.
95+
- **SolrJ dependency:** Upgrade `solr-solrj` from 9.x to 10.x in `gradle/libs.versions.toml`. The Jetty BOM alignment (`jetty = "10.0.22"`) will also need updating since Solr 10 uses Jetty 12.x.
96+
7697
## Key Configuration
7798

7899
Environment variables:

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ tasks.withType<Test> {
153153
excludeTags("docker-integration")
154154
}
155155
}
156+
// Forward solr.test.image system property to test JVMs for Solr version compatibility testing
157+
systemProperty("solr.test.image", System.getProperty("solr.test.image", "solr:9.9-slim"))
156158
if (name != "dockerIntegrationTest") {
157159
finalizedBy(tasks.jacocoTestReport)
158160
}

src/test/java/org/apache/solr/mcp/server/TestcontainersConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public class TestcontainersConfiguration {
2929

3030
@Bean
3131
SolrContainer solr() {
32-
return new SolrContainer(DockerImageName.parse("solr:9.9-slim"));
32+
String solrImage = System.getProperty("solr.test.image");
33+
return new SolrContainer(DockerImageName.parse(solrImage));
3334
}
3435

3536
@Bean

src/test/java/org/apache/solr/mcp/server/containerization/DockerImageHttpIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class DockerImageHttpIntegrationTest {
9595

9696
// Docker image name and tag from build-info.properties
9797
private static final String DOCKER_IMAGE = BuildInfoReader.getDockerImageName();
98-
private static final String SOLR_IMAGE = "solr:9.9-slim";
98+
private static final String SOLR_IMAGE = System.getProperty("solr.test.image");
9999
private static final int HTTP_PORT = 8080;
100100

101101
// Network for container communication

src/test/java/org/apache/solr/mcp/server/containerization/DockerImageStdioIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class DockerImageStdioIntegrationTest {
8585

8686
// Docker image name and tag from build-info.properties
8787
private static final String DOCKER_IMAGE = BuildInfoReader.getDockerImageName();
88-
private static final String SOLR_IMAGE = "solr:9.9-slim";
88+
private static final String SOLR_IMAGE = System.getProperty("solr.test.image");
8989

9090
// Network for container communication
9191
private static final Network network = Network.newNetwork();

0 commit comments

Comments
 (0)