- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1k
 
convert groovy smoke tests to java, part 1 #14648
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
convert groovy smoke tests to java, part 1 #14648
Conversation
        
          
                smoke-tests/src/test/java/io/opentelemetry/smoketest/AgentDebugLoggingTest.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | startTarget(8); | ||
| stopTarget(); | 
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.
try {
  startTarget(8);
} finally {
  stopTarget();
}would be java equivalent of the original groovy code. I'd probably move the stopTarget to a cleanup method
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.
that would work it this test but fail here, because cleanup is not done in between a parameterized test.
I added "withTarget" - which works with parameterized tests.
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.testcontainers.containers.output.OutputFrame; | ||
| 
               | 
          ||
| public abstract class JavaSmokeTest { | 
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.
not really a fan of using the Java prefix, guess we can rename it back once all tests are converted
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.
yes, waiting for ideas here - cound also rename the groovy classes to have a "Legacy" prefix
| import java.util.function.Supplier; | ||
| import java.util.stream.Collectors; | ||
| 
               | 
          ||
| public class JavaTelemetryRetriever { | 
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.
I guess this class is equivalent to the original groovy version? Did you consider deleting the groovy version and just keeping this one? Imo it is fine to keep both for now if it makes it easier for you.
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.
I just wanted to avoid having to learn how groovy java interop works...
        
          
                smoke-tests/src/test/java/io/opentelemetry/smoketest/LogsSmokeTest.java
              
                Outdated
          
            Show resolved
            Hide resolved
        
      5fd2a36    to
    5e8f1d2      
    Compare
  
    | 
           @laurit I guess this has to do with the shade I added - but I don't understand it: For GatewayRouteMappingTest:  | 
    
| 
           Thanks @laurit !  | 
    
| protected String getTargetImage(String jdk) { | ||
| return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk" | ||
| + jdk | ||
| + "-20211213.1570880324"; | 
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.
what do you think about taking this opportunity to pull in a newer one of these?
| + "-20211213.1570880324"; | |
| + "-20250915.17728045097"; | 
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 should better be a renovate rule then - I'd suggest to do that as a follow-up.
An idea would be to have the same tag for all images to make it easier to create a rule.
The tag is set here:
opentelemetry-java-instrumentation/.github/workflows/reusable-publish-smoke-test-images.yml
Line 61 in 98072b9
| run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV | 
If we change it to GITHUB_SHA then it would be the same for all artfacts.
@trask wdyt?
| protected String getTargetImage(String jdk) { | ||
| return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-quarkus:jdk" | ||
| + jdk | ||
| + "-20241105.11678591860"; | 
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.
| + "-20241105.11678591860"; | |
| + "-20250915.17728045126"; | 
| protected String getTargetImage(String jdk) { | ||
| return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk" | ||
| + jdk | ||
| + "-20211213.1570880324"; | 
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.
| + "-20211213.1570880324"; | |
| + "-20250915.17728045097"; | 
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.
the new image doesn't seem to work
| protected String getTargetImage(String jdk) { | ||
| return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-security-manager:jdk" | ||
| + jdk | ||
| + "-20241021.11448062560"; | 
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.
| + "-20241021.11448062560"; | |
| + "-20250915.17728045123"; | 
No description provided.