Skip to content

Commit

Permalink
fix: update sdk to add testSet to dedupData as well (#179)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
PranshuSrivastava authored Aug 26, 2024
1 parent 378a573 commit 35b3eca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
HttpServletResponse response = (HttpServletResponse) servletResponse;

String keploy_test_id = request.getHeader("KEPLOY-TEST-ID");
String keploy_test_set_id = request.getHeader("KEPLOY-TEST-SET-ID");
// logger.debug("KEPLOY-TEST-ID: {}", keploy_test_id);
filterChain.doFilter(request, response);
if (System.getenv("ENABLE_DEDUP") != null) {
Expand All @@ -89,7 +90,7 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
// Run getCoverage in a separate thread
// Thread coverageThread = new Thread(() -> {
try {
getCoverage(keploy_test_id);
getCoverage(keploy_test_id, keploy_test_set_id);
} catch (InterruptedException | IOException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -180,7 +181,7 @@ public synchronized void execWriter2(String keploy_test_id) throws IOException {
}
}

public void getCoverage(String keploy_test_id) throws IOException, InterruptedException {
public void getCoverage(String keploy_test_id, String keploy_test_set_id) throws IOException, InterruptedException {

try {
execWriter(keploy_test_id);
Expand All @@ -189,7 +190,7 @@ public void getCoverage(String keploy_test_id) throws IOException, InterruptedEx
}

try {
execReader(keploy_test_id);
execReader(keploy_test_id, keploy_test_set_id);
} catch (IOException e) {
e.printStackTrace(); // Example: print the stack trace
}
Expand All @@ -200,7 +201,7 @@ public void shutdownExecutor() {
executorService.shutdown();
}

private void execReader(String keploy_test_id) throws IOException {
private void execReader(String keploy_test_id, String keploy_test_set_id) throws IOException {
// Together with the original class definition we can calculate coverage
// information:
out.println("------------------------------------------");
Expand Down Expand Up @@ -249,7 +250,7 @@ private void execReader(String keploy_test_id) throws IOException {
// System.out.println("Line_Path: " + Line_Path);

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

Expand Down
2 changes: 1 addition & 1 deletion keploy-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,4 @@
</plugins>
</build>

</project>
</project>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
Expand All @@ -107,7 +107,7 @@
</goals>
</execution>
</executions>
</plugin>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down

0 comments on commit 35b3eca

Please sign in to comment.