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

Release fix #166

Merged
merged 4 commits into from
Feb 22, 2024
Merged

Release fix #166

merged 4 commits into from
Feb 22, 2024

Conversation

Sarthak160
Copy link
Member

Related Issue

  • Info about Issue or bug

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas and used java doc.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Screenshots (if any)

Original Updated
original screenshot updated screenshot

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;

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 {

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);

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);

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)) {

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) {

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

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

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);

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());

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).

Sarthak160 and others added 2 commits February 22, 2024 16:59
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;

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;

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() {

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() {

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);

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

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).

Copy link
Contributor

@re-Tick re-Tick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@re-Tick
Copy link
Contributor

re-Tick commented Feb 22, 2024

Merging the PR

@re-Tick re-Tick merged commit e1613b0 into main Feb 22, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants