Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ The agent binds `/tmp/coverage_control.sock` before the application's `main` run

### 1. Download the Keploy Java Agent

Download the `keploy-sdk` jar and keep it outside your application dependencies. The jar is a Java agent and should be attached only when you run Keploy dynamic deduplication.
Download `io.keploy:keploy-sdk` **`>= 2.3.0`** (current release: **`2.4.0`**) and keep it outside your application dependencies. The jar is a Java agent and should be attached only when you run Keploy dynamic deduplication.

It works with apps that serve HTTP through Tomcat (8.5 to 11), Jetty (9.4 to 12.1), or Undertow (2.2 and 2.3), such as Spring Boot MVC and Dropwizard, as an executable jar, from a classpath, or as a WAR. On other servers, such as Netty (Spring WebFlux), gRPC, Vert.x, Micronaut, or JDK `HttpServer`, Keploy keeps every test case.

```xml
<plugin>
Expand All @@ -68,7 +70,7 @@ Download the `keploy-sdk` jar and keep it outside your application dependencies.
<artifactItem>
<groupId>io.keploy</groupId>
<artifactId>keploy-sdk</artifactId>
<version>2.0.5</version>
<version>2.4.0</version>
<outputDirectory>${project.build.directory}</outputDirectory>
<destFileName>keploy-sdk.jar</destFileName>
</artifactItem>
Expand Down Expand Up @@ -114,22 +116,7 @@ SDK starts JaCoCo 0.8.16 whether the app's jar comes before or after
`keploy-sdk.jar` on the class path, and the app's `AgentJar` reads the app's own
`jacocoagent.jar`, also in a Spring Boot fat jar.

If the command attaches a JaCoCo agent of its own (`-javaagent:jacocoagent.jar`,
before or after keploy-sdk.jar, or in `JAVA_TOOL_OPTIONS`), the SDK starts none
and reads coverage from that one. The SDK reads it through JaCoCo's in-process
runtime API (`org.jacoco.agent.rt.RT.getAgent()`). That JaCoCo instruments
every class its own options take in. If the in-process API is unavailable (for
example because the JaCoCo agent is loaded into an isolated classloader), the
SDK falls back to JaCoCo's TCP server mode. To use the fallback explicitly,
start JaCoCo in `tcpserver` mode and set `KEPLOY_JACOCO_HOST` /
`KEPLOY_JACOCO_PORT`:

```bash
java \
-javaagent:/path/to/jacocoagent.jar=address=127.0.0.1,port=36320,output=tcpserver \
-javaagent:/path/to/keploy-sdk.jar \
-jar your-app.jar
```
> **Important:** Attach **only** `-javaagent:/path/to/keploy-sdk.jar`. Do **not** attach a separate `-javaagent:/path/to/jacocoagent.jar` alongside it — adding a separate JaCoCo agent prevents the SDK from starting its scoped embedded JaCoCo agent, can mismatch JaCoCo versions, and breaks per-test code-path and code-coverage collection.

### 3. Replay with Keploy Enterprise

Expand All @@ -141,8 +128,6 @@ keploy test -c "java -javaagent:/path/to/keploy-sdk.jar -jar your-app.jar" \
--language java
```

When using the TCP fallback, also pass `--pass-through-ports <jacoco-port>` so Keploy does not try to mock the JaCoCo control connection.

After replay, run:

```bash
Expand Down
Loading