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

Switch MongoDB tests to use Docker #2922

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

ppkarwasz
Copy link
Contributor

MongoDB is a binary server. The current log4j-mongodb tests download a generic binary MongoDB distribution and try to run it. The distribution is not self-contained and requires several libraries (e.g., OpenSSL) to be available on the target host.

Those libraries are not always available in the required version: e.g., currently MongoDB needs OpenSSL 1, but OpenSSL 3 is bundled in the most recent Debian.

This PR switches from the binary distribution to the usage of the latest Docker image available.

The advantages of this approach are:

  • We always test against the newest server version available.
  • The success of the tests does not depend on the libraries installed on the host.
  • Tests can run in parallel. In the current approach, parallel tests failed since each one tried to download MongoDB separately.

The main disadvantage is that Docker will be required to test log4j-mongodb. This is the case for the CI, but individual developers might need to install it too.

Fixes #2229.

@ppkarwasz ppkarwasz self-assigned this Sep 6, 2024
Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

Nice improvement @ppkarwasz 😀

@ppkarwasz
Copy link
Contributor Author

Nice improvement @ppkarwasz 😀

Does it mean you approve? If not, what changes are you expecting?

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

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

Fat fingers! I approve.

Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

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

Locally verified the PR. Dropped some minor requests/questions.

Question: Will this get ported to 2.x?

I will align the <activation> of the docker profile of log4j-template-layout-json-test with this PR, once this gets merged.

log4j-mongodb/pom.xml Show resolved Hide resolved
log4j-mongodb/pom.xml Show resolved Hide resolved
log4j-mongodb/pom.xml Show resolved Hide resolved
@ppkarwasz ppkarwasz force-pushed the feature/main/2229_mongodb_docker branch from c275e34 to 6a59e03 Compare September 12, 2024 16:26
@ppkarwasz
Copy link
Contributor Author

Oh, tests are stuck, it must be Friday 13th again! 😉

MongoDB is a binary server. The current `log4j-mongodb`
tests download a **generic** binary MongoDB distribution
and try to run it. The distribution is not self-contained
and requires several libraries (e.g., OpenSSL) to be available
on the target host.

Those libraries are not always available in the required version:
e.g., currently MongoDB needs OpenSSL 1, but OpenSSL 3 is bundled
in the most recent Debian.

This PR switches from the binary distribution to the usage of
the **latest** Docker image available.

The advantages of this approach are:

- We always test against the newest server version available.
- The success of the tests does not depend on the libraries
  installed on the host.
- Tests can run in parallel. In the current approach, parallel
  tests failed since each one tried to download MongoDB
  separately.

The main disadvantage is that Docker will be required to test
`log4j-mongodb`. This is the case for the CI, but individual
developers might need to install it too.

Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
@ppkarwasz ppkarwasz force-pushed the feature/main/2229_mongodb_docker branch from b9e0df2 to 9cede69 Compare September 13, 2024 17:21
@ppkarwasz ppkarwasz merged commit 9cede69 into main Sep 13, 2024
9 checks passed
@ppkarwasz ppkarwasz deleted the feature/main/2229_mongodb_docker branch September 13, 2024 17:58
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.

3 participants