Skip to content

test: remove brittle assertions and a null image default - #177

Open
adityamparikh wants to merge 1 commit into
apache:mainfrom
adityamparikh:test/suite-robustness-upstream
Open

test: remove brittle assertions and a null image default#177
adityamparikh wants to merge 1 commit into
apache:mainfrom
adityamparikh:test/suite-robustness-upstream

Conversation

@adityamparikh

@adityamparikh adityamparikh commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Verified findings from a CodeRabbit review. Test-only — no production code is touched.

  • DockerImageHttpIntegrationTest read solr.test.image with no default, so DockerImageName.parse received null whenever the property was unset. Now uses the same default as DockerImageMcpClientStdioIntegrationTest.
  • SampleClient asserted an exact tool count of 8; the server exposes 11, and the list went stale as soon as create-collection, add-fields and add-field-types were added. Now a lower bound plus per-name presence, so adding a tool will not break it.
  • CollectionServiceIntegrationTest required select.errors() and select.timeouts() to be null. Solr may omit these counters or report an explicit 0, and both mean nothing went wrong — the test depended on which.
  • McpClientIntegrationTestBase.assertNotError cast the first content item to TextContent, so a non-text error payload raised ClassCastException and hid the actual failure message.
  • Renamed SolrConfigTestSolrConfigIntegrationTest: it is @Tag("integration") and starts Testcontainers, contradicting the project's *Test = unit / *IntegrationTest = integration convention documented in AGENTS.md.

Verification

./gradlew build on JDK 25, against real Solr via Testcontainers: BUILD SUCCESSFUL — 352 tests, 0 failures, 0 errors, 7 skipped. No spotless drift.

🤖 Generated with Claude Code

Verified findings from a CodeRabbit review.

- DockerImageHttpIntegrationTest read solr.test.image with no default, so
  DockerImageName.parse received null whenever the property was unset. Use
  the same default as DockerImageMcpClientStdioIntegrationTest.
- SampleClient asserted an exact tool count of 8; the server exposes 11, and
  the list went stale as soon as create-collection, add-fields and
  add-field-types were added. Assert a lower bound plus per-name presence.
- CollectionServiceIntegrationTest required select.errors() and
  select.timeouts() to be null. Solr may omit these counters or report an
  explicit 0, and both mean "nothing went wrong"; the test depended on which.
- McpClientIntegrationTestBase.assertNotError cast the first content item to
  TextContent, so a non-text error payload raised ClassCastException and hid
  the actual failure message.
- Renamed SolrConfigTest to SolrConfigIntegrationTest. It is
  @tag("integration") and starts Testcontainers, so the old name contradicted
  the project's *Test = unit / *IntegrationTest = integration convention.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant