-
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
Conversation
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
Co-authored-by: trask <[email protected]>
Co-authored-by: trask <[email protected]>
Copilot finished work on behalf of
trask
September 30, 2025 19:16
trask
reviewed
Sep 30, 2025
.../src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/AbstractLog4j2Test.java
Outdated
Show resolved
Hide resolved
Co-authored-by: trask <[email protected]>
Copilot finished work on behalf of
trask
September 30, 2025 19:36
trask
reviewed
Sep 30, 2025
instrumentation/log4j/log4j-appender-2.17/testing/build.gradle.kts
Outdated
Show resolved
Hide resolved
instrumentation/log4j/log4j-appender-2.17/testing/build.gradle.kts
Outdated
Show resolved
Hide resolved
instrumentation/log4j/log4j-appender-2.17/library/src/test/resources/log4j2.xml
Show resolved
Hide resolved
Co-authored-by: trask <[email protected]>
Co-authored-by: trask <[email protected]>
Copilot finished work on behalf of
trask
September 30, 2025 20:44
Copilot finished work on behalf of
trask
September 30, 2025 21:04
Co-authored-by: trask <[email protected]>
Copilot finished work on behalf of
trask
September 30, 2025 21:11
🔧 The result from spotlessApply was committed to the PR branch. |
superseded by #14859 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Plan: Unify tests between log4j-appender-2.17 javaagent and library instrumentation
Based on my analysis of the repository structure and the issue requirements, I will:
testing
module underinstrumentation/log4j/log4j-appender-2.17/
addCodeLocationAttributes
to only handle code location attributesSummary
Successfully created a unified testing module for log4j-appender-2.17 that contains shared test code (
AbstractLog4j2Test
) which both javaagent and library instrumentation can extend. This follows the pattern used by other instrumentations in the repository (e.g., jsf-jakarta-common).Key Changes:
AbstractLog4j2Test
base class containing common testsaddCodeLocationAttributes
only handles code location, thread and test-specific attributes added separatelyBoth javaagent and library now share the same test suite, significantly reducing code duplication and ensuring consistent behavior. Library-specific tests (builder API, log replay, span propagation) remain in their respective test classes.
Fixes #4956
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.