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

Adds testcontainer based JUnit tests #433

Merged
merged 21 commits into from
May 19, 2023
Merged

Conversation

scottopell
Copy link
Contributor

@scottopell scottopell commented Apr 18, 2023

Adds a container-based test to flex the instance recovery subsystem.
Also adds a "misbehaving jmx server" which is a java application exposing a JMX server where you can inject faults into it. See readme of the "misbehaving jmx server" for a list of what it can do today.

TODO

  • Add docker-desktop instructions for running test-container based JUnit tests (basically add below notes to README)

Docker Desktop Notes

Its useful to run the mvn test execution itself within a container for docker-desktop. This is because docker-desktop (at least on macos) will run the containers on a VM which is isolated from the host.
Example command:

# From within the jmxfetch project directory
docker run -it --rm -e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock maven:3.8-eclipse-temurin-8 mvn test -Dtest=TestReconnectContainer

src/test/resources/jmxint_container.yaml Outdated Show resolved Hide resolved
tools/misbehaving-jmx-server/README.md Show resolved Hide resolved
tools/misbehaving-jmx-server/README.md Show resolved Hide resolved
tools/misbehaving-jmx-server/pom.xml Outdated Show resolved Hide resolved
@scottopell scottopell marked this pull request as ready for review May 10, 2023 21:06
…439)

* An example of a JMXFetch config and one using AD with Docker labels

* Update tools/misbehaving-jmx-server/README.md

Co-authored-by: Scott Opell <me@scottopell.com>

* Update tools/misbehaving-jmx-server/README.md

Co-authored-by: Scott Opell <me@scottopell.com>

---------

Co-authored-by: Scott Opell <me@scottopell.com>
carlosroman
carlosroman previously approved these changes May 18, 2023
@scottopell scottopell merged commit e20eabd into master May 19, 2023
2 checks passed
@scottopell scottopell deleted the sopell/testcontainers branch May 19, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants