Home / Companies / Elastic / Blog / Post Details
Content Deep Dive

Regression testing your Java Agent Plugin

Blog post from Elastic

Post Details
Company
Date Published
Author
-
Word Count
1,419
Language
-
Hacker News Points
-
Summary

Jack Shirazi's article discusses the process of regression testing for developers who have created their own instrumentation using the Java Agent plugin, with a focus on ensuring the plugin functions as expected after code changes. The article uses an example repository to illustrate the regression testing process, which involves using a mock APM server to simulate the Elastic APM server, allowing for the automated validation of data captured by the agent. The testing sequence begins with the Java Virtual Machine (JVM) starting and includes loading the agent and plugin, running test code, and sending captured data to the mock server for validation. Key implementation details include configuring the ElasticApmAttacher.attach() mechanism and setting up a mock APM server to handle JSON over HTTP communication. The article emphasizes the importance of automating the inspection process to validate test results, and it outlines the steps required to build and run tests using Maven, including handling potential communication delays between the agent and the mock server. Shirazi concludes by encouraging readers to try the process using the provided example repository and highlights the benefits of starting with Elastic APM in the cloud.