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

feat: assert and fail mvn test if the keploy test fails #169

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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

</execution>
</executions>
</plugin>

Copy link

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.regexp.RegexpSinglelineCheck> reported by reviewdog 🐶
Line has trailing spaces.

@@ -35,7 +35,7 @@ public class Keploy {
private static long userCommandPid = 0;

private static String jacocoCliPath = "";

private static String currentTestRunId;
Copy link

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.

@@ -477,9 +477,24 @@ public static void runTests(String jarPath) {
}
stopUserApplication();
}
logger.debug("All test sets executed and stoping the ebpf hooks" );
logger.debug("All test sets executed and stopping the ebpf hooks" );
Copy link

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.whitespace.ParenPadCheck> reported by reviewdog 🐶
')' is preceded with whitespace.

}
} catch (InterruptedException e) {
System.err.println("Error waiting for test run completion: " + e.getMessage());
logger.error("Error waiting for test run completion: " + e.getMessage());
Copy link

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

@@ -35,8 +35,11 @@ public class Keploy {
private static long userCommandPid = 0;

private static String jacocoCliPath = "";

private static String currentTestRunId;
Copy link

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 String jacocoAgentPath = "";
private static Boolean isFailed = false;
Copy link

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 String jacocoAgentPath = "";
private static Boolean isFailed = false;
private static List<String> failedTestSets = new ArrayList<>();
Copy link

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 String jacocoAgentPath = "";
private static Boolean isFailed = false;
private static List<String> failedTestSets = new ArrayList<>();

Copy link

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.regexp.RegexpSinglelineCheck> reported by reviewdog 🐶
Line has trailing spaces.


// Check the test run status after all tests are executed

// change to each test run and at last if any of the test failed then throw an
Copy link

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

// TestRunStatus status = FetchTestSetStatus(currentTestRunId);
// Throw an exception if the status is FAILED
if (isFailed) {
org.junit.jupiter.api.Assertions.fail("Test run failed for test sets : " + failedTestSets);
Copy link

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

@Sarthak160
Copy link
Member Author

@gouravkrosx Please run this once at your end, So that I can merge and release .

logger.info("Test run failed");
isFailed = true;
failedTestSets.add(currentTestRunId);

Copy link

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.regexp.RegexpSinglelineCheck> reported by reviewdog 🐶
Line has trailing spaces.

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.

1 participant