Skip to content

Commit

Permalink
fix: update sdk to add testSet to dedupData as well
Browse files Browse the repository at this point in the history
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
  • Loading branch information
PranshuSrivastava committed Jul 23, 2024
1 parent 378a573 commit bbebe22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 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
20 changes: 0 additions & 20 deletions keploy-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,26 +148,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down
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 bbebe22

Please sign in to comment.