Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Kafka integration test #206

Merged
merged 7 commits into from
Dec 21, 2022
Merged

Conversation

robbavey
Copy link
Member

What does this PR do?

This PR adds integration tests for the Kafka output, with the use cases, and some of the mechanics around reading events from a kafka topic ported from the beats output.

This PR also includes infrastructure to create a test docker image with Kafka, exposing ports to allow testing over plaintext and SSL.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
    - [ ] I have added an entry in CHANGELOG.md or CHANGELOG-developer.md.

How to test this PR locally

  • Run docker-compose up in the testing/environment/docker folder
  • Run mage integrationTest

Note that I needed to delete the docker_kafka container after each test run to allow the tests to continue to run.

Related issues

Relates #166, #176

@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2022

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @robbavey? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 19, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-12-20T22:46:44.305+0000

  • Duration: 16 min 32 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@robbavey robbavey force-pushed the kafka_integration_test branch from a50e004 to 3aa795f Compare December 19, 2022 18:22
@robbavey
Copy link
Member Author

/test

@cmacknz cmacknz added the Team:Elastic-Agent Label for the Agent team label Dec 19, 2022
@robbavey robbavey marked this pull request as ready for review December 20, 2022 14:31
@robbavey robbavey requested a review from a team as a code owner December 20, 2022 14:31
@robbavey robbavey requested review from fearful-symmetry and faec and removed request for a team December 20, 2022 14:31
Copy link
Contributor

@faec faec left a comment

Choose a reason for hiding this comment

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

This looks great, thank you. It looks like there will be some followup to make these tests runnable in CI / without manually starting containers, but considering the impending holiday I'm happy to worry about that after the other pending integration tests are merged.

version: '2.3'
services:
kafka:
build: /Users/robbavey/code/elastic-agent-shipper/testing/environment/docker/dockerfiles/kafka
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, missed this initially, it looks like this file needs to have the home directory stripped out or maybe just be deleted if you were just using it for testing the prototype

Copy link
Member Author

Choose a reason for hiding this comment

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

🤦‍♂️ Done

@faec
Copy link
Contributor

faec commented Dec 20, 2022

One other thing if you have time before merging: can you put this in testing/environments/kafka instead of testing/environment/docker? (My pending ES container is in testing/environments/elasticsearch)

Also fix reference to my personal directory in docker-compose file
@robbavey
Copy link
Member Author

robbavey commented Dec 20, 2022

I've moved the files @faec - ket me know if this structure works for you

@faec
Copy link
Contributor

faec commented Dec 20, 2022

Looks great, thank you again! Don't worry about waiting on @fearful-symmetry for merge, they are already out for the holiday :-)

@robbavey robbavey merged commit 7e8fd00 into elastic:main Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants