-
-
Notifications
You must be signed in to change notification settings - Fork 587
feat(kafka): add apache/kafka and apache/kafka-native support #3249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
strowk
wants to merge
56
commits into
testcontainers:main
Choose a base branch
from
strowk:feature/kafka_native
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+803
−33
Open
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
1ef2f84
feat(kafka_native): new module
strowk 4ebe2d1
feat(kafka_native): new module
strowk 0a80e8c
feat: merge kafka native into kafka module
strowk 32b803c
Merge branch 'main' into feature/kafka_native
strowk 0e2dfab
chore: correct unit test naming
strowk 57f0cd9
chore: remove kafka_native doc
strowk cb66883
chore: small doc correction
strowk 246fdae
chore: remove all kafka native folder
strowk e5c5ebb
Merge branch 'main' into feature/kafka_native
strowk b131199
chore: remove kafka_native from mkdocs
strowk 13e9773
docs: explain default behavior
strowk 5da08a1
chore: refactor to make linter happy
strowk d641100
chore: simplify helper function
strowk 5a57c72
chore: test graceful shutdown for apache images
strowk ea05212
chore: test for more versions
strowk b55f3fd
chore: rename tests
strowk 5cbb28d
chore: graceful shutdown should not give error
strowk 5946d39
chore: test already calls stop, drop extra timeout
strowk 9c948d2
docs: give more guidance to pick kafka image
strowk 9ae246b
docs: correct snippet ref
strowk 12a1ae9
docs: wording adjustment
strowk 99b4833
feat: allow to override starter script
strowk b51a341
chore: clean, doc and linter
strowk a2eb5e3
chore: fix linter issues
strowk b21194e
feat: add localhost listener to both flavors
strowk 4b7ebda
provide With..Flavor options
strowk 4d5a299
go doc for options
strowk 8c1a7ab
update option go doc
strowk 9adbde3
update doc about flavor option
strowk fcfee34
fix to not have side effect when returning error
strowk f227e38
update go doc for options
strowk 164ff1b
document images difference
strowk 31f4579
document options better
strowk f6f75b2
document localhost listener
strowk 1e916ee
move localhost doc into separate section
strowk 9a00515
add benchmarks and correct time docs
strowk ad56cd2
fix doc typo
strowk a3a5cb7
update images pick table
strowk fb876de
ideomatic benchmark error handling
strowk 57b8a7c
fix lint issue in benchmark
strowk 5fe7204
docs: add since version markers
strowk 0e923e0
docs: clarify when apache images are available
strowk f83d07d
docs: separate image pick section from usage
strowk b65ba06
docs: simplify doc with reference to detailed option
strowk 4f02648
docs: link starter script section
strowk 8706053
docs: add since version marker to localhost listener
strowk 5f5e8fb
docs: align section header
strowk b8de9b1
chore: simplify test assertion
strowk c6a2b1d
chore: simplify benchmark assertion
strowk 81b1065
fix: return error if conflicting options are given
strowk 34242df
chore: formatting from linter
strowk 907ce01
docs: explain conflicting options
strowk 4627d1b
chore: simplify test assertions
strowk 1fc9b85
chore: correct typo in test
strowk 68f2f3f
chore: add apache/kafka test cases
strowk 3034eea
docs: better describe image detection
strowk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package kafka_test | ||
|
|
||
| import ( | ||
| "context" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
|
|
||
| "github.com/testcontainers/testcontainers-go" | ||
| "github.com/testcontainers/testcontainers-go/modules/kafka" | ||
| ) | ||
|
|
||
| func startStopBenchmark(b *testing.B, image string) { | ||
| b.Helper() | ||
| for b.Loop() { | ||
| kafkaContainer, err := kafka.Run(context.Background(), | ||
| image, | ||
| ) | ||
| require.NoError(b, err) | ||
|
|
||
| err = testcontainers.TerminateContainer(kafkaContainer) | ||
| require.NoError(b, err) | ||
| } | ||
| } | ||
|
|
||
| func BenchmarkConfluentStartStop(b *testing.B) { | ||
| startStopBenchmark(b, "confluentinc/confluent-local:7.5.0") | ||
| } | ||
|
|
||
| func BenchmarkApacheNativeStartStop(b *testing.B) { | ||
| startStopBenchmark(b, "apache/kafka-native:4.0.1") | ||
| } | ||
|
|
||
| func BenchmarkApacheStartStop(b *testing.B) { | ||
| startStopBenchmark(b, "apache/kafka:4.0.1") | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.