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

RestIntegTestTask fails because of missed log4j-core dependency #1815

Merged
merged 1 commit into from
Dec 28, 2021

Conversation

reta
Copy link
Collaborator

@reta reta commented Dec 28, 2021

Signed-off-by: Andriy Redko andriy.redko@aiven.io

Description

Using opensearch.yaml-rest-test Gradle plugin outside of the OpenSearch core (fe, in plugins), for example yamlRestTest, fails with the following exception:

> Task :yamlRestTest

org.opensearch.path.to.plugin.RenameClientYamlTestSuiteIT > initializationError FAILED
    java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/Layout

Since the log4j-core is declared as optional, it is not being picked up. Adding it as an explicit dependency does not solve the problem either (see please opensearch-project/opensearch-plugin-template-java#16 for more details) because the task uses dedicated configuration yamlRestTestImplementation and only its dependencies.

Issues Resolved

Closes #1814

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Sorry, something went wrong.

@reta reta requested a review from a team as a code owner December 28, 2021 15:55
@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@reta
Copy link
Collaborator Author

reta commented Dec 28, 2021

@saratvemulapalli @dblock the root cause is clear now: the yamlRestTest uses dedicated configuration named yamlRestTestImplementation and explicitly adds only org.opensearch.test:framework. Since the log4j-core is declared as optional, it is not being picked up (outside the core builds).

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure def1710508c0f56511ab2d6bda20f4b85e7dcd66
Log 1695

Reports 1695

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 4ec9bcb
Log 1696

Reports 1696

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

There's got to be a better fix than this, but YOLO.

@dblock dblock merged commit 65813b8 into opensearch-project:main Dec 28, 2021
reta added a commit to reta/OpenSearch that referenced this pull request Dec 28, 2021
@reta
Copy link
Collaborator Author

reta commented Dec 28, 2021

There's got to be a better fix than this, but YOLO.

I think with the way the plugin is implemented right now, the fix is fine - single place where the dependencies are set up. But surely, there are other ways to fix that.

reta added a commit to reta/OpenSearch that referenced this pull request Dec 28, 2021
dblock pushed a commit that referenced this pull request Dec 28, 2021
… (#1818)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
dblock pushed a commit that referenced this pull request Dec 28, 2021
… (#1819)

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] RestIntegTestTask fails because of missed log4j-core dependency
3 participants