Skip to content

Conversation

@trask
Copy link
Member

@trask trask commented Oct 1, 2025

Resolves #4956

@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

Copy link
Member Author

Choose a reason for hiding this comment

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

these tests were moved to the shared testing base class

Copy link
Member Author

Choose a reason for hiding this comment

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

these tests were mostly redundant with the javaagent tests which were moved to the new shared base class

}

@Test
void logWithSpan() { // Does not work for log replay, but it is not likely to occur because
Copy link
Member Author

Choose a reason for hiding this comment

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

redundant with the new shared base class tests

<OpenTelemetry name="OpenTelemetryAppender" numLogsCapturedBeforeOtelInstall="1" captureMapMessageAttributes="true" captureMarkerAttribute="true" captureContextDataAttributes="key1,key2" captureExperimentalAttributes="true" captureCodeAttributes="true"/>
</Appenders>
<Loggers>
<Logger name="TestLogger" level="All">
Copy link
Member Author

Choose a reason for hiding this comment

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

TestLogger is still used by library tests which were not redundant with common tests

@otelbot-java-instrumentation
Copy link
Contributor

🔧 The result from spotlessApply was committed to the PR branch.

@trask trask force-pushed the unify-log4j2-appender-tests branch from 679f376 to 5b21e7f Compare October 3, 2025 02:30
@trask trask marked this pull request as ready for review October 3, 2025 03:13
@trask trask requested a review from a team as a code owner October 3, 2025 03:13
@trask trask force-pushed the unify-log4j2-appender-tests branch from 3f45b8b to e9cf224 Compare October 3, 2025 16:03
@trask trask marked this pull request as draft October 4, 2025 03:37
@trask trask force-pushed the unify-log4j2-appender-tests branch 2 times, most recently from e60b07a to 227205c Compare October 8, 2025 03:20
@trask trask force-pushed the unify-log4j2-appender-tests branch 2 times, most recently from ccd8ecc to 41fbe1f Compare October 8, 2025 23:25
void testContextData() {
ThreadContext.put("key1", "val1");
ThreadContext.put("key2", "val2");
ThreadContext.put("event.name", "MyEventName");
Copy link
Member Author

@trask trask Oct 8, 2025

Choose a reason for hiding this comment

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

this line (and its assertion below) found a bug in the Java agent instrumentation

@trask trask force-pushed the unify-log4j2-appender-tests branch from 41fbe1f to 98f6d92 Compare October 8, 2025 23:32
@trask trask marked this pull request as ready for review October 8, 2025 23:32
@trask trask merged commit 75f2ca3 into open-telemetry:main Oct 9, 2025
81 checks passed
@trask trask deleted the unify-log4j2-appender-tests branch October 9, 2025 14:23
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.

Unify tests between log4j-appender-2.16 javaagent and library instrumentation

3 participants