-
Notifications
You must be signed in to change notification settings - Fork 19
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
Release fix #166
Release fix #166
Conversation
Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
@@ -1,13 +1,11 @@ | |||
package io.keploy.cli; | |||
package io.keploy; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck> reported by reviewdog 🐶
Missing package-info.java file.
@@ -26,12 +23,12 @@ | |||
//FOR CLI CODE COVERAGE REFERENCE: https://dzone.com/articles/code-coverage-report-generator-for-java-projects-a | |||
|
|||
// Jacococli & JacocoAgent version: 0.8.8 | |||
public class KeployCLI { | |||
public class Keploy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck> reported by reviewdog 🐶
Utility classes should not have a public or default constructor.
|
||
private static final String GRAPHQL_ENDPOINT = "/query"; | ||
private static final String HOST = "http://localhost:"; | ||
|
||
private static final Logger logger = LogManager.getLogger(KeployCLI.class); | ||
private static final Logger logger = LogManager.getLogger(Keploy.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck> reported by reviewdog 🐶
Missing a Javadoc comment.
|
||
private static final String GRAPHQL_ENDPOINT = "/query"; | ||
private static final String HOST = "http://localhost:"; | ||
|
||
private static final Logger logger = LogManager.getLogger(KeployCLI.class); | ||
private static final Logger logger = LogManager.getLogger(Keploy.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck> reported by reviewdog 🐶
Name 'logger' must match pattern '^[A-Z][A-Z0-9](_[A-Z0-9]+)$'.
@@ -90,7 +87,7 @@ public static void StartUserApplication(String runCmd) throws IOException { | |||
private static String attachJacocoAgent(String cmd) { | |||
String resourcePath = "jacocoagent.jar"; // Relative path in the JAR file | |||
|
|||
try (InputStream is = KeployCLI.class.getClassLoader().getResourceAsStream(resourcePath)) { | |||
try (InputStream is = Keploy.class.getClassLoader().getResourceAsStream(resourcePath)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 80 characters (found 96).
} | ||
} | ||
|
||
private static void waitForTestRunCompletion(String testRunId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck> reported by reviewdog 🐶
Parameter testRunId should be final.
|
||
private static void waitForTestRunCompletion(String testRunId) { | ||
// Implement the logic to wait for test run completion using KeployCLI | ||
long MAX_TIMEOUT = 6000000; // 1m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck> reported by reviewdog 🐶
Name 'MAX_TIMEOUT' must match pattern '^[a-z][a-zA-Z0-9]*$'.
|
||
private static void waitForTestRunCompletion(String testRunId) { | ||
// Implement the logic to wait for test run completion using KeployCLI | ||
long MAX_TIMEOUT = 6000000; // 1m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck> reported by reviewdog 🐶
'6000000' is a magic number.
Keploy.TestRunStatus testRunStatus; | ||
|
||
while (true) { | ||
Thread.sleep(2000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck> reported by reviewdog 🐶
'2000' is a magic number.
System.out.println("Test run passed"); | ||
} | ||
} catch (InterruptedException e) { | ||
System.err.println("Error waiting for test run completion: " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 80 characters (found 91).
Signed-off-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
@@ -46,6 +43,7 @@ public class GraphQLResponse { | |||
|
|||
public class Data { | |||
String[] testSets; | |||
Boolean stopTest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck> reported by reviewdog 🐶
Missing a Javadoc comment.
@@ -46,6 +43,7 @@ public class GraphQLResponse { | |||
|
|||
public class Data { | |||
String[] testSets; | |||
Boolean stopTest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck> reported by reviewdog 🐶
Variable 'stopTest' must be private and have accessor methods.
@@ -347,6 +344,41 @@ public static String RunTestSet(String testSetName) { | |||
|
|||
} | |||
|
|||
// Hit GraphQL query to stop the test | |||
public static Boolean StopTest() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck> reported by reviewdog 🐶
Missing a Javadoc comment.
@@ -347,6 +344,41 @@ public static String RunTestSet(String testSetName) { | |||
|
|||
} | |||
|
|||
// Hit GraphQL query to stop the test | |||
public static Boolean StopTest() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck> reported by reviewdog 🐶
Name 'StopTest' must match pattern '^[a-z][a-zA-Z0-9]*$'.
logger.debug("response body received: {}", resBody); | ||
// Parse the response body using Gson | ||
Gson gson = new Gson(); | ||
GraphQLResponse response = gson.fromJson(resBody, GraphQLResponse.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 80 characters (found 89).
Gson gson = new Gson(); | ||
GraphQLResponse response = gson.fromJson(resBody, GraphQLResponse.class); | ||
|
||
return response.data.stopTest; // this will return the Boolean value of stopTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [checkstyle] <com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck> reported by reviewdog 🐶
Line is longer than 80 characters (found 96).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merging the PR |
Related Issue
Closes: #[issue number that will be closed through this PR]
Describe the changes you've made
A clear and concise description of what you have done to successfully close your assigned issue. Any new files? or anything you feel to let us know!
Type of change
How did you test your code changes?
Please describe the tests(if any). Provide instructions how its affecting the coverage.
Describe if there is any unusual behaviour of your code(Write
NA
if there isn't)A clear and concise description of it.
Checklist:
Screenshots (if any)