-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use docker-compose to run the functional tests #1695
Conversation
* Functional tests are skipped except when the `functional` build tag is passed to the go test command (i.e. go test -tags=functional) * If TOXIPROXY_ADDR is not set when the functional tests are being run, it will use docker-compose to automatically spin up a zookeeper/kafka/toxiproxy environment suitab le for running the tests. This requies a working Docker and for the docker-compose command line tool to be installed. * If TOXIPROXY_ADDR and KAFKA_VERSION are set, then the tests will not spin up any docker infrastructure and will instead rely on whatever kafka broker is behind the specified toxiproxy.
@KJTsanaktsidis this looks good RE: the docker images and version mapping, I wonder if we should just use a Java base image for the containers and volume mount in the extracted Kafka tgz and the server.properties we were generating? I remember we had some custom (short) timeouts etc. to make the toxiproxy tests complete more quickly etc. so it might be easier to manage our own Kafka within the container |
Actually I replicated those configs in the compose file - the confluent kafka image transforms environment variables of the form
This could work but makes it much more difficult to run the test environment by hand (to persist it across runs when iterating on them for example). We could however build our own Kafka images from a Dockerfile - I think docker-compose might even be smart enough to build them once the first time someone writes a functional test and use the same image for subsequent runs. |
509158a
to
a9e0b4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let @d1egoaz re-review this one but LGTM.
sorry, I just looked at this a second time since I was on the page and noticed there was a spot where I'd hardcoded kafka 2.5.0 for debugging purposes 🤦 Fixed and pushed. |
One of the pieces of #1695 was to use a small jar for publishing uncommited messages as part of the functional test. Replacing that with the native Sarama transactional producer Fixes #1733 Co-authored-by: KJTsanaktsidis <[email protected]>
One of the pieces of #1695 was to use a small jar for publishing uncommited messages as part of the functional test. Replacing that with the native Sarama transactional producer Fixes #1733 Co-authored-by: KJTsanaktsidis <[email protected]>
One of the pieces of #1695 was to use a small jar for publishing uncommited messages as part of the functional test. Replacing that with the native Sarama transactional producer Fixes #1733 Co-authored-by: KJTsanaktsidis <[email protected]>
One of the pieces of #1695 was to use a small jar for publishing uncommited messages as part of the functional test. Replacing that with the native Sarama transactional producer Fixes #1733 Co-authored-by: KJTsanaktsidis <[email protected]>
One of the pieces of #1695 was to use a small jar for publishing uncommited messages as part of the functional test. Replacing that with the native Sarama transactional producer Fixes #1733 Co-authored-by: KJTsanaktsidis <[email protected]>
One of the pieces of #1695 was to use a small jar for publishing uncommited messages as part of the functional test. Replacing that with the native Sarama transactional producer Fixes #1733 Co-authored-by: KJTsanaktsidis <[email protected]>
CC @bai @dnwe - I took a stab at changing how the functional tests run as we discussed in #1661. Let me know what you think!
This PR makes a few changes:
go test
runs the unit tests, and runninggo test -tags=integration
will run all tests, including the functional testsTOXIPROXY_ADDR
isn't setOpen questions:
confluentinc/cp-{kafka,zookeeper}
), which have a different versioning scheme to the upstream apache kafka project. This leads to some pretty ugly mapping code to deduce the kafka version from the confluent platform version, and vice versa. Unfortunately this seems to be the "msot official" kafka image I could find. Open to other suggestions on what we should use though.FunctionalTestEnv
now).docker-compose up
in the "install dependancies" part of the github action workflow, instead of relying on it to be automatically invoked as part of "run test suite"