Skip to content

Kafka Connect: Capture integration test logs in CI#16504

Open
wombatu-kun wants to merge 2 commits into
apache:mainfrom
wombatu-kun:kafka-connect/capture-integration-test-logs
Open

Kafka Connect: Capture integration test logs in CI#16504
wombatu-kun wants to merge 2 commits into
apache:mainfrom
wombatu-kun:kafka-connect/capture-integration-test-logs

Conversation

@wombatu-kun
Copy link
Copy Markdown
Contributor

@wombatu-kun wombatu-kun commented May 21, 2026

Summary

Split out from #16438 per reviewer request. Two related improvements to integration-test observability in CI:

  • Capture docker container logs (kafka, connect, iceberg) to build/testlogs/<service>-container.log via testcontainers withLogConsumer, so coordinator-side failures are visible when an Awaitility timeout surfaces as a bare AssertionError.
  • Mirror the unit-test testLogging / addTestOutputListener configuration on the integrationTest Gradle task, and extend the Kafka Connect CI artifact upload to also include **/build/reports/tests/integrationTest.

Vova Kolmakov and others added 2 commits May 21, 2026 14:19
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant