Skip to content

fix(test): restore docker image tag suffix for native integration tests - #173

Open
adityamparikh wants to merge 2 commits into
apache:mainfrom
adityamparikh:fix/native-docker-image-tags
Open

fix(test): restore docker image tag suffix for native integration tests#173
adityamparikh wants to merge 2 commits into
apache:mainfrom
adityamparikh:fix/native-docker-image-tags

Conversation

@adityamparikh

Copy link
Copy Markdown
Contributor

Summary

The two native Docker image + integration jobs in native.yml fail on every branch and PR (e.g. PR #159's run) with:

ContainerFetchException: Can't get Docker image: RemoteDockerImage(imageName=solr-mcp:1.0.0-SNAPSHOT, ...)

The Paketo native build tags its image solr-mcp:<version>-native-stdio / -native-http, but all three Docker integration tests resolve the plain solr-mcp:<version> tag, which the native path never produces. The MCP stdio protocol test's docker run subprocess exits immediately on the missing image, surfacing as a 20s initialize() timeout instead.

Root cause

PR #139 removed the caller-side + System.getProperty("solr.mcp.docker.image.tag.suffix") concatenation from the three test classes on the premise that BuildInfoReader.getDockerImageName() "already appends the same system property internally" — but it never did (it was just String.format("%s:%s", artifact, version)). The suffix stopped being applied at all, even though build.gradle.kts still sets solr.mcp.docker.image.tag.suffix for dockerIntegrationTest -Pnative and the test Javadoc still documents it as applied.

Changes

  • BuildInfoReader.getDockerImageName() now appends the solr.mcp.docker.image.tag.suffix system property (default ""), so the suffix is applied exactly once, matching fix(test): stop double-appending docker image tag suffix #139's documented intent. The JVM (Jib) path is unchanged: the property is unset there, so the tag stays solr-mcp:<version>.
  • Add the containerization tests and BuildInfoReader to native.yml's trigger paths so future changes to the native validation suite re-run the native matrix.

Verification (local, macOS arm64)

  • ./gradlew spotlessCheck build passes (unit + integration tests; the JVM path resolves the same tag as before).
  • End-to-end with companion PR fix(native): register DefaultMetaProvider reflection hint to unbreak nativeTest #172 applied: bootBuildImage -Pnative + dockerIntegrationTest -Pnative → tests resolve solr-mcp:1.0.0-SNAPSHOT-native-stdio and pass: DockerImageMcpClientStdioIntegrationTest (39 tests, full MCP JSON-RPC workflow) and DockerImageStdioIntegrationTest (4 tests). The http leg as well: dockerIntegrationTest -Pnative -Pprofile=httpDockerImageHttpIntegrationTest (6 tests) passes against solr-mcp:1.0.0-SNAPSHOT-native-http.

Merge order

This fixes the image resolution failure. With the tag fixed, the docker tests reach the actual native binary — which then needs the DefaultMetaProvider reflection hint from companion PR #172 (the resourceSpecs bean is part of the real application context). Suggest merging the companion first, then this PR turns the native matrix fully green.

🤖 Generated with Claude Code

The native dockerIntegrationTest matrix (stdio/http) was failing because the
three Docker integration tests resolved their image as
`solr-mcp:<version>` with no `-native-<profile>` suffix, so Testcontainers
404'd pulling an image the native build never produces (it builds
`solr-mcp:<version>-native-stdio` / `-native-http`). The MCP stdio test's
`docker run` subprocess then exited immediately, surfacing as a 20s
`initialize()` timeout.

PR apache#139 removed the caller-side `+ System.getProperty("solr.mcp.docker.image.tag.suffix")`
concatenation on the premise that `BuildInfoReader.getDockerImageName()`
"already appends the same system property internally" — but it never did
(it was just `String.format("%s:%s", artifact, version)`), so the suffix
stopped being applied entirely.

Make `getDockerImageName()` append the suffix internally, matching apache#139's
documented intent and the test Javadoc. The property is unset on the JVM
(Jib) path, defaulting to an empty string, so that tag is unchanged; the
suffix is now applied exactly once. Also add the containerization tests and
BuildInfoReader to native.yml's trigger paths so future changes to these
files exercise the native matrix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
Review follow-up on this PR. The suffix handling is otherwise exercised
only by dockerIntegrationTest, which regular CI never runs — that gap is
how PR apache#139 could silently drop the suffix and break the native image
matrix. BuildInfoReaderTest pins the contract in the default test task.

Also corrects DockerImageMcpClientStdioIntegrationTest's javadoc, which
still described the pre-apache#139 call-site concatenation and a "-native"
suffix value that never existed — the same doc-vs-code drift that caused
the original regression.

Co-Authored-By: Claude Fable 5 <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