Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update sdk to add testSet to dedupData as well #179

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
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
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
Loading