Skip to content
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

fix(kafka): Add Kraft to Kafka containers #611

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

jfmlima
Copy link
Contributor

@jfmlima jfmlima commented Jun 20, 2024

Following a similar strategy as several other testcontainers implementations, this PR introduces the possibility to run Kafka in KRAft mode.

with KafkaContainer().with_kraft() as container:
    # Test something with/on KRaft mode

@alexanderankin alexanderankin changed the title feat(kafka): Add Kraft to Kafka containers fix(kafka): Add Kraft to Kafka containers Jun 20, 2024
@alexanderankin alexanderankin added the community-feat feature but its a community module so we wont bump tc core for it label Jun 20, 2024
Copy link
Member

@alexanderankin alexanderankin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can make it pass, ill merge.

lmk if you need any help running the ci locally

Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@090bd0d). Learn more about missing BASE report.

Current head 7562f56 differs from pull request most recent head 7763552

Please upload reports for the commit 7763552 to get more accurate results.

Files Patch % Lines
core/testcontainers/core/version.py 0.00% 20 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #611   +/-   ##
=======================================
  Coverage        ?   76.91%           
=======================================
  Files           ?       11           
  Lines           ?      602           
  Branches        ?       86           
=======================================
  Hits            ?      463           
  Misses          ?      112           
  Partials        ?       27           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jfmlima jfmlima requested a review from alexanderankin June 20, 2024 19:59
@jfmlima
Copy link
Contributor Author

jfmlima commented Jun 20, 2024

if you can make it pass, ill merge.

lmk if you need any help running the ci locally

Thanks, I'm using act and see how it goes, hopefully I've fixed all issues, but running locally now just in case 👍

@jfmlima
Copy link
Contributor Author

jfmlima commented Jun 21, 2024

if you can make it pass, ill merge.

lmk if you need any help running the ci locally

Hey @alexanderankin do you mind giving me some tips on how to run the ci locally please? act alone was not enough as it has some issues with the python setup. Thanks!

Edit: Got it, had to replace poetry installation with

- name: Install Poetry
  uses: snok/install-poetry@v1

@jfmlima
Copy link
Contributor Author

jfmlima commented Jun 21, 2024

@alexanderankin all sorted, feel free to re-run the ci 👍

@alexanderankin
Copy link
Member

sorry for the delay in response, looks like you got it sorted. here it is anyway

python -m venv ~/.poetry-venv && source ~/.poetry-venv/bin/activate && pip install poetry && ln -s $(which poetry) ~/.local/bin # or wherever you put bins
deactivate

git clone.... && cd testcontainers-python

poetry install --with dev -E kafka
poetry shell # starts shell

make modules/kafka/tests
make modules/kafka/<tab to autocomplete>

or even just
pytest -s modules/kafka/tests

and then also remember to
pre-commit run -a

@alexanderankin alexanderankin merged commit 762d2a2 into testcontainers:main Jun 21, 2024
13 checks passed
alexanderankin pushed a commit that referenced this pull request Jun 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[4.7.0](testcontainers-v4.6.0...testcontainers-v4.7.0)
(2024-06-28)


### Features

* **core:** Added Generic module
([#612](#612))
([e575b28](e575b28))
* **core:** allow custom dockerfile path for image build and bypassing
build cache
([#615](#615))
([ead0f79](ead0f79)),
closes
[#610](#610)
* **core:** DockerCompose.stop now stops only services that it starts
(does not stop the other services)
([#620](#620))
([e711800](e711800))


### Bug Fixes

* **ollama:** Add support for ollama module
([#618](#618))
([5442d05](5442d05))
* **cosmosdb:** Add support for the CosmosDB Emulator
([#579](#579))
([8045a80](8045a80))
* improve ollama docs, s/ollama_dir/ollama_home/g
([#619](#619))
([27f2a6b](27f2a6b))
* **kafka:** Add Kraft to Kafka containers
([#611](#611))
([762d2a2](762d2a2))


### Documentation

* **contributing:** add contribution and new-container guide
([#460](#460))
([3519f4b](3519f4b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-feat feature but its a community module so we wont bump tc core for it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants