- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1k
Unify Log4j2 appender tests #14859
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
Unify Log4j2 appender tests #14859
Conversation
| 🔧 The result from spotlessApply was committed to the PR branch. | 
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 | 
There was a problem hiding this comment.
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"> | 
There was a problem hiding this comment.
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
| 🔧 The result from spotlessApply was committed to the PR branch. | 
679f376    to
    5b21e7f      
    Compare
  
            
          
                .../src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/AbstractLog4j2Test.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                .../src/main/java/io/opentelemetry/instrumentation/log4j/appender/v2_17/AbstractLog4j2Test.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      3f45b8b    to
    e9cf224      
    Compare
  
    e60b07a    to
    227205c      
    Compare
  
    ccd8ecc    to
    41fbe1f      
    Compare
  
    | void testContextData() { | ||
| ThreadContext.put("key1", "val1"); | ||
| ThreadContext.put("key2", "val2"); | ||
| ThreadContext.put("event.name", "MyEventName"); | 
There was a problem hiding this comment.
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
41fbe1f    to
    98f6d92      
    Compare
  
    
Resolves #4956