-
Notifications
You must be signed in to change notification settings - Fork 1k
Unify tests between log4j-appender-2.17 javaagent and library instrumentation #14843
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
840e615
Initial plan
Copilot bbc3463
Create testing module with shared base test class
Copilot 86c8349
Fix test assertions to work with both javaagent and library
Copilot 8e87cca
Refactor assertion building to match original structure
Copilot 0c93bad
Remove unnecessary dependencies from testing module
Copilot 8e2318c
Change log4j-core from api to compileOnly dependency
Copilot 4e458f4
Remove duplicative tests from AbstractOpenTelemetryAppenderTest
Copilot 51813e1
spotless
trask 85eaf45
fix
trask 28ceb8e
Remove unnecessary test now
trask 881d19d
./gradlew spotlessApply
otelbot[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...brary/src/test/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/Log4j2Test.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.instrumentation.log4j.appender.v2_17; | ||
|
|
||
| import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; | ||
| import io.opentelemetry.instrumentation.testing.junit.LibraryInstrumentationExtension; | ||
| import org.junit.jupiter.api.AfterAll; | ||
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
|
||
| class Log4j2Test extends AbstractLog4j2Test { | ||
|
|
||
| @RegisterExtension | ||
| static final LibraryInstrumentationExtension testing = | ||
| LibraryInstrumentationExtension.create(); | ||
|
|
||
| @BeforeEach | ||
| void setup() { | ||
| OpenTelemetryAppender.install(testing.getOpenTelemetry()); | ||
| } | ||
|
|
||
| @AfterAll | ||
| static void cleanup() { | ||
| OpenTelemetryAppender.install(null); | ||
| } | ||
|
|
||
| @Override | ||
| protected InstrumentationExtension testing() { | ||
| return testing; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
instrumentation/log4j/log4j-appender-2.17/testing/build.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| plugins { | ||
| id("otel.java-conventions") | ||
| } | ||
|
|
||
| dependencies { | ||
| api(project(":testing-common")) | ||
| api("io.opentelemetry:opentelemetry-sdk-testing") | ||
|
|
||
| api("org.apache.logging.log4j:log4j-core:2.17.0") | ||
trask marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| api("org.apache.logging.log4j:log4j-api:2.17.0") | ||
|
|
||
| compileOnly("com.google.auto.value:auto-value-annotations") | ||
| annotationProcessor("com.google.auto.value:auto-value") | ||
trask marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.