Kafka Connect: Capture integration test logs in CI#16504
Open
wombatu-kun wants to merge 2 commits into
Open
Conversation
The integration tests drive their workloads through a testcontainers docker compose stack (kafka, connect, iceberg REST catalog, minio). The Kafka Connect coordinator does the actual snapshot commit work, and its logs live in the Connect container's stdout — never in the JVM test worker. So when an Awaitility timeout surfaced as a bare AssertionError in CI, there was no way to see why the commit did not happen.
Attach a withLogConsumer for the connect, kafka, and iceberg services in TestContext, writing each service's container output to ${rootDir}/build/testlogs/<service>-container.log. The location is passed in from the integrationTest Gradle task via a `dockerLogDir` system property and falls back to a no-op when unset (so the constructor still works under IDEs or ad-hoc runs). The Kafka Connect CI artifact upload already covers `**/build/testlogs`, so on failure the docker logs come along automatically.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sts in CI
The `integrationTest` Gradle task carried no `addTestOutputListener` and no `testLogging` block, so test-process stdout/stderr was lost and the Gradle console output for CI showed only a bare `FAILED` line and the assertion source location, with no stack trace or AssertJ description. The Kafka Connect CI workflow uploaded only `**/build/testlogs`, which is populated by the unit test task in the root `build.gradle` but not by `integrationTest`.
Mirror the existing `test` block from the root `build.gradle` inside the `integrationTest` task: stream per-test output to `${rootDir}/build/testlogs/${project.name}-integration.log` (a separate file from the unit-test log), and emit verbose `testLogging` events with `exceptionFormat "full"` on CI. Extend the Kafka Connect CI artifact upload to also include `**/build/reports/tests/integrationTest` so the HTML reports with per-test stack traces are preserved.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Split out from #16438 per reviewer request. Two related improvements to integration-test observability in CI:
build/testlogs/<service>-container.logvia testcontainerswithLogConsumer, so coordinator-side failures are visible when an Awaitility timeout surfaces as a bareAssertionError.testLogging/addTestOutputListenerconfiguration on theintegrationTestGradle task, and extend the Kafka Connect CI artifact upload to also include**/build/reports/tests/integrationTest.