Rework integration tests from docker-compose to testcontainers-go#303
Closed
korniltsev-grafanista-yolo-vibecoder239 wants to merge 1 commit into
Conversation
Replace the split test infrastructure (docker-compose YAML, Go main program, Makefile orchestration) with a single Go test file using testcontainers-go. Each OS/Java variant is now a top-level test function discoverable via go test -list, and the CI workflow discovers tests dynamically instead of maintaining a hardcoded matrix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Thanks for the contribution! We're continuing this work on a branch in the main repository so we can run CI and merge from there. Please see the replacement draft PR: #319 Closing this PR in favor of that one. |
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
Replaces the split integration test infrastructure with a single Go test file using testcontainers-go, matching the patterns used by pyroscope-dotnet and otel-profiling-java.
Previously, the test logic was scattered across three places:
docker-compose-itest.yaml— defined 27 service containers (Alpine × Java, Ubuntu × Java)itest/query/main.go— a standalone Go program (not a test) that queried PyroscopeMakefile— orchestrated docker-compose up → go run → docker-compose downNow everything lives in
itest/integration_test.go:Test*functions, one per OS/Java variant, each calling a sharedrunVarianthelperalpine-test.Dockerfile,ubuntu-test.Dockerfile) are built viaFromDockerfilewith build argsassert.Eventuallypolls Pyroscope for the expectedFib.fibstack trace (3 min timeout, 5s interval)The CI workflow now uses a discover-then-run pattern (like otel-profiling-java): a first job runs
go test -list . ./...to discover all test functions, then a matrix job runs each in parallel. The variant list is defined entirely in Go — no duplication in YAML.Changes
itest/integration_test.go— 27 test functions + helpers (startPyroscope, startApp, testTarget, stackCollapseProto)itest/go.mod— modulepyroscope-java-itestwith testcontainers-go and testify.github/workflows/itest.yml— two-job discover-then-run pattern, no hardcoded matrixMakefile—itesttarget now runsgo testdirectlydocker-compose-itest.yaml,itest/query/(main.go, go.mod, go.sum)Test plan
go test -v -timeout 60m -count=1 ./...)go test -list . ./...discovers all 27 test functions