-
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
feat: add support to run keploy v2 with unit tests #154
Conversation
Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
checkstyle
v2/src/main/java/io.keploy.cli/KeployCLI.java|52 col 9| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|55| Line is longer than 80 characters (found 87).
v2/src/main/java/io.keploy.cli/KeployCLI.java|60| Line is longer than 80 characters (found 129).
v2/src/main/java/io.keploy.cli/KeployCLI.java|60 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|60 col 24| Name 'RunKeployServer' must match pattern '^[a-z][a-zA-Z0-9]$'.
v2/src/main/java/io.keploy.cli/KeployCLI.java|60 col 40| Parameter pid should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|60 col 50| Parameter delay should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|60 col 61| Parameter testPath should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|60 col 78| Parameter port should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|66 col 30| '1000' is a magic number.
v2/src/main/java/io.keploy.cli/KeployCLI.java|74| Line is longer than 80 characters (found 93).
v2/src/main/java/io.keploy.cli/KeployCLI.java|75| Line is longer than 80 characters (found 167).
v2/src/main/java/io.keploy.cli/KeployCLI.java|112| Line is longer than 80 characters (found 112).
v2/src/main/java/io.keploy.cli/KeployCLI.java|114| Line is longer than 80 characters (found 82).
v2/src/main/java/io.keploy.cli/KeployCLI.java|140 col 33| '15000' is a magic number.
v2/src/main/java/io.keploy.cli/KeployCLI.java|141 col 36| '10000' is a magic number.
v2/src/main/java/io.keploy.cli/KeployCLI.java|143| Line is longer than 80 characters (found 87).
v2/src/main/java/io.keploy.cli/KeployCLI.java|155 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|155 col 28| Name 'FetchTestSets' must match pattern '^[a-z][a-zA-Z0-9]$'.
v2/src/main/java/io.keploy.cli/KeployCLI.java|178| Line is longer than 80 characters (found 89).
v2/src/main/java/io.keploy.cli/KeployCLI.java|180| Line is longer than 80 characters (found 85).
v2/src/main/java/io.keploy.cli/KeployCLI.java|191 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|191 col 33| Name 'FetchTestSetStatus' must match pattern '^[a-z][a-zA-Z0-9]$'.
v2/src/main/java/io.keploy.cli/KeployCLI.java|191 col 52| Parameter testRunId should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|200| Line is longer than 80 characters (found 93).
v2/src/main/java/io.keploy.cli/KeployCLI.java|218| Line is longer than 80 characters (found 89).
v2/src/main/java/io.keploy.cli/KeployCLI.java|239 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|239 col 26| Name 'RunTestSet' must match pattern '^[a-z][a-zA-Z0-9]$'.
v2/src/main/java/io.keploy.cli/KeployCLI.java|239 col 37| Parameter testSetName should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|247| Line is longer than 80 characters (found 116).
v2/src/main/java/io.keploy.cli/KeployCLI.java|265| Line is longer than 80 characters (found 89).
v2/src/main/java/io.keploy.cli/KeployCLI.java|278| Line is longer than 80 characters (found 92).
v2/src/main/java/io.keploy.cli/KeployCLI.java|278 col 49| Parameter conn should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|280 col 33| '200' is a magic number.
v2/src/main/java/io.keploy.cli/KeployCLI.java|280 col 55| '300' is a magic number.
v2/src/main/java/io.keploy.cli/KeployCLI.java|283| Line is longer than 80 characters (found 94).
v2/src/main/java/io.keploy.cli/KeployCLI.java|283 col 51| Parameter conn should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|284| Line is longer than 80 characters (found 93).
v2/src/main/java/io.keploy.cli/KeployCLI.java|296 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|296 col 24| Name 'StopKeployServer' must match pattern '^[a-z][a-zA-Z0-9]*$'.
v2/src/main/java/io.keploy.cli/KeployCLI.java|301 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|301 col 42| Parameter port should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|302 col 65| ',' is not followed by whitespace.
v2/src/main/java/io.keploy.cli/KeployCLI.java|307| Line is longer than 80 characters (found 104).
v2/src/main/java/io.keploy.cli/KeployCLI.java|317 col 47| Parameter pid should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|319 col 36| '+' is not followed by whitespace.
v2/src/main/java/io.keploy.cli/KeployCLI.java|319 col 36| '+' is not preceded with whitespace.
v2/src/main/java/io.keploy.cli/KeployCLI.java|320 col 42| ',' is not followed by whitespace.
Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
checkstyle
v2/src/main/java/io.keploy.cli/KeployCLI.java|265| Line is longer than 80 characters (found 89).
v2/src/main/java/io.keploy.cli/KeployCLI.java|278| Line is longer than 80 characters (found 92).
v2/src/main/java/io.keploy.cli/KeployCLI.java|278 col 49| Parameter conn should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|280 col 33| '200' is a magic number.
v2/src/main/java/io.keploy.cli/KeployCLI.java|280 col 55| '300' is a magic number.
v2/src/main/java/io.keploy.cli/KeployCLI.java|283| Line is longer than 80 characters (found 94).
v2/src/main/java/io.keploy.cli/KeployCLI.java|283 col 51| Parameter conn should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|284| Line is longer than 80 characters (found 93).
v2/src/main/java/io.keploy.cli/KeployCLI.java|296 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|296 col 24| Name 'StopKeployServer' must match pattern '^[a-z][a-zA-Z0-9]*$'.
v2/src/main/java/io.keploy.cli/KeployCLI.java|301 col 5| Missing a Javadoc comment.
v2/src/main/java/io.keploy.cli/KeployCLI.java|301 col 42| Parameter port should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|302 col 65| ',' is not followed by whitespace.
v2/src/main/java/io.keploy.cli/KeployCLI.java|307| Line is longer than 80 characters (found 104).
v2/src/main/java/io.keploy.cli/KeployCLI.java|317 col 47| Parameter pid should be final.
v2/src/main/java/io.keploy.cli/KeployCLI.java|319 col 36| '+' is not followed by whitespace.
v2/src/main/java/io.keploy.cli/KeployCLI.java|319 col 36| '+' is not preceded with whitespace.
v2/src/main/java/io.keploy.cli/KeployCLI.java|320 col 42| ',' is not followed by whitespace.
public enum TestRunStatus { | ||
RUNNING, | ||
PASSED, | ||
FAILED |
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.
FAILED | ||
} | ||
|
||
// public static void main(String[] args) throws IOException, InterruptedException { |
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 87).
|
||
|
||
// Run Keploy server | ||
public static void RunKeployServer(long pid, int delay, String testPath, int port) throws InterruptedException, IOException { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
|
||
// Run Keploy server | ||
public static void RunKeployServer(long pid, int delay, String testPath, int port) throws InterruptedException, IOException { |
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.
|
||
|
||
// Run Keploy server | ||
public static void RunKeployServer(long pid, int delay, String testPath, int port) throws InterruptedException, IOException { |
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 'RunKeployServer' 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).
|
||
|
||
// Run a particular testSet | ||
public static String RunTestSet(String testSetName) { |
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.
|
||
|
||
// Run a particular testSet | ||
public static String RunTestSet(String testSetName) { |
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 'RunTestSet' must match pattern '^[a-z][a-zA-Z0-9]*$'.
|
||
|
||
// Run a particular testSet | ||
public static String RunTestSet(String testSetName) { |
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 testSetName should be final.
} | ||
|
||
String payload = String.format( | ||
"{ \"query\": \"mutation { runTestSet(testSet: \\\"%s\\\") { success testRunId message } }\" }", |
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 116).
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
Related Issue
Describe the changes you've made
Added KeployCLI class which contains global functions to run keploy tests along with junit tests.
To run keploy tests along with exisiting junit tests, you just have to add this Test function in your test file.
Type of change
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)NA
Checklist:
Screenshots (if any)