From bbebe226d8c93ddce23e97e7f8926bc0b9e6f2f1 Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Tue, 23 Jul 2024 15:32:39 +0530 Subject: [PATCH 1/2] fix: update sdk to add testSet to dedupData as well Signed-off-by: Pranshu Srivastava --- .../io/keploy/servlet/KeployMiddleware.java | 11 +++++----- keploy-sdk/pom.xml | 20 ------------------- pom.xml | 4 ++-- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/integration/src/main/java/io/keploy/servlet/KeployMiddleware.java b/integration/src/main/java/io/keploy/servlet/KeployMiddleware.java index 0738d793..97730fb9 100644 --- a/integration/src/main/java/io/keploy/servlet/KeployMiddleware.java +++ b/integration/src/main/java/io/keploy/servlet/KeployMiddleware.java @@ -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) { @@ -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); } @@ -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); @@ -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 } @@ -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("------------------------------------------"); @@ -249,7 +250,7 @@ private void execReader(String keploy_test_id) throws IOException { // System.out.println("Line_Path: " + Line_Path); Map testData = new HashMap<>(); - testData.put("id", keploy_test_id); + testData.put("id", keploy_test_set_id+ "/" + keploy_test_id); // Map test1 = createTestData("test-1",testData); testData.put("executedLinesByFile", executedLinesByFile); diff --git a/keploy-sdk/pom.xml b/keploy-sdk/pom.xml index de8e7e6a..f05cbb3c 100644 --- a/keploy-sdk/pom.xml +++ b/keploy-sdk/pom.xml @@ -148,26 +148,6 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - org.codehaus.mojo build-helper-maven-plugin diff --git a/pom.xml b/pom.xml index cecaca28..e292f812 100644 --- a/pom.xml +++ b/pom.xml @@ -94,7 +94,7 @@ - + org.apache.maven.plugins maven-javadoc-plugin From a8662e5e1847f27eb998dfb925aa47020305376c Mon Sep 17 00:00:00 2001 From: Pranshu Srivastava Date: Mon, 26 Aug 2024 12:47:43 +0530 Subject: [PATCH 2/2] fix: removed unnecessary changes Signed-off-by: Pranshu Srivastava --- keploy-sdk/pom.xml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/keploy-sdk/pom.xml b/keploy-sdk/pom.xml index f05cbb3c..72cd223f 100644 --- a/keploy-sdk/pom.xml +++ b/keploy-sdk/pom.xml @@ -148,6 +148,26 @@ + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + org.codehaus.mojo build-helper-maven-plugin @@ -176,4 +196,4 @@ - + \ No newline at end of file