Skip to content

Commit 35b3eca

Browse files
fix: update sdk to add testSet to dedupData as well (#179)
* fix: update sdk to add testSet to dedupData as well Signed-off-by: Pranshu Srivastava <[email protected]> * fix: removed unnecessary changes Signed-off-by: Pranshu Srivastava <[email protected]> --------- Signed-off-by: Pranshu Srivastava <[email protected]>
1 parent 378a573 commit 35b3eca

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

integration/src/main/java/io/keploy/servlet/KeployMiddleware.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
7777
HttpServletResponse response = (HttpServletResponse) servletResponse;
7878

7979
String keploy_test_id = request.getHeader("KEPLOY-TEST-ID");
80+
String keploy_test_set_id = request.getHeader("KEPLOY-TEST-SET-ID");
8081
// logger.debug("KEPLOY-TEST-ID: {}", keploy_test_id);
8182
filterChain.doFilter(request, response);
8283
if (System.getenv("ENABLE_DEDUP") != null) {
@@ -89,7 +90,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
8990
// Run getCoverage in a separate thread
9091
// Thread coverageThread = new Thread(() -> {
9192
try {
92-
getCoverage(keploy_test_id);
93+
getCoverage(keploy_test_id, keploy_test_set_id);
9394
} catch (InterruptedException | IOException e) {
9495
throw new RuntimeException(e);
9596
}
@@ -180,7 +181,7 @@ public synchronized void execWriter2(String keploy_test_id) throws IOException {
180181
}
181182
}
182183

183-
public void getCoverage(String keploy_test_id) throws IOException, InterruptedException {
184+
public void getCoverage(String keploy_test_id, String keploy_test_set_id) throws IOException, InterruptedException {
184185

185186
try {
186187
execWriter(keploy_test_id);
@@ -189,7 +190,7 @@ public void getCoverage(String keploy_test_id) throws IOException, InterruptedEx
189190
}
190191

191192
try {
192-
execReader(keploy_test_id);
193+
execReader(keploy_test_id, keploy_test_set_id);
193194
} catch (IOException e) {
194195
e.printStackTrace(); // Example: print the stack trace
195196
}
@@ -200,7 +201,7 @@ public void shutdownExecutor() {
200201
executorService.shutdown();
201202
}
202203

203-
private void execReader(String keploy_test_id) throws IOException {
204+
private void execReader(String keploy_test_id, String keploy_test_set_id) throws IOException {
204205
// Together with the original class definition we can calculate coverage
205206
// information:
206207
out.println("------------------------------------------");
@@ -249,7 +250,7 @@ private void execReader(String keploy_test_id) throws IOException {
249250
// System.out.println("Line_Path: " + Line_Path);
250251

251252
Map<String, Object> testData = new HashMap<>();
252-
testData.put("id", keploy_test_id);
253+
testData.put("id", keploy_test_set_id+ "/" + keploy_test_id);
253254
// Map<String, Object> test1 = createTestData("test-1",testData);
254255
testData.put("executedLinesByFile", executedLinesByFile);
255256

keploy-sdk/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,4 @@
196196
</plugins>
197197
</build>
198198

199-
</project>
199+
</project>

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
</execution>
9595
</executions>
9696
</plugin>
97-
<plugin>
97+
<!-- <plugin>
9898
<groupId>org.apache.maven.plugins</groupId>
9999
<artifactId>maven-gpg-plugin</artifactId>
100100
<version>1.5</version>
@@ -107,7 +107,7 @@
107107
</goals>
108108
</execution>
109109
</executions>
110-
</plugin>
110+
</plugin> -->
111111
<plugin>
112112
<groupId>org.apache.maven.plugins</groupId>
113113
<artifactId>maven-javadoc-plugin</artifactId>

0 commit comments

Comments
 (0)