-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add annotation to tag tests by test case ID #336
base: master
Are you sure you want to change the base?
Add annotation to tag tests by test case ID #336
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #336 +/- ##
=============================================
- Coverage 58.86% 10.65% -48.22%
+ Complexity 126 34 -92
=============================================
Files 16 16
Lines 564 582 +18
Branches 33 37 +4
=============================================
- Hits 332 62 -270
- Misses 207 519 +312
+ Partials 25 1 -24 ☔ View full report in Codecov by Sentry. |
@@ -4,7 +4,7 @@ | |||
<groupId>org.kiwitcms.java</groupId> | |||
<artifactId>kiwitcms-junit-plugin</artifactId> | |||
<packaging>jar</packaging> | |||
<version>12.5</version> | |||
<version>12.6</version> |
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.
Revert this change:
<version>12.6</version> | |
<version>12.5</version> |
@@ -36,6 +42,7 @@ but that should be redundant: | |||
@ExtendWith(KiwiTcmsExtension.class) | |||
public class KiwiJsonRpcClientTest { | |||
@Test | |||
@TcmsTestCaseId(11) |
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.
Add comment to clarify example:
@TcmsTestCaseId(11) | |
@TcmsTestCaseId(11) // optional |
public @interface TcmsTestCaseId | ||
{ | ||
int value(); | ||
} |
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.
What is the purpose of this class? Is this where the new annotation is defined? If yes, I think model/
isn't the appropriate place for it. Maybe create a new directory like annotations/
? WDYT ?
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.
Or maybe add this class into TestMethod.java
? Not sure what makes sense here.
@@ -411,4 +411,22 @@ public TestExecutionStatus getTestExecutionStatus(String name, String weightLook | |||
return null; | |||
} | |||
} | |||
|
|||
public TestCase getTestCaseById(int testCaseId) { |
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.
This will need some test coverage.
I will review this one first, before reviewing the extended version. |
@TcmsTestCaseId()
annotation to the@Test
method.If you have a nicely maintained Kiwi instance, where the test cases are manually added and your code doesn't reflect the names, then the TCMS junit plugin won't be able to find them properly (just by searching by name). By adding the
@TcmsTestCaseId()
annotation, you can override which test case is returned to the test plan. In case of invalid ID being provided the plugin will do the standard test case search.