Skip to content

Conversation

@Angelthree95
Copy link
Contributor

  • Added the ability to search exclusively by case ID with @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.

@codecov
Copy link

codecov bot commented Jul 16, 2023

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.

Project coverage is 10.65%. Comparing base (c4f5aeb) to head (fd95cb5).
Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/main/java/org/kiwitcms/java/api/RpcClient.java 0.00% 11 Missing ⚠️
.../java/org/kiwitcms/java/junit/TestDataEmitter.java 0.00% 5 Missing ⚠️
...ava/org/kiwitcms/java/junit/KiwiTcmsExtension.java 0.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

<artifactId>kiwitcms-junit-plugin</artifactId>
<packaging>jar</packaging>
<version>12.5</version>
<version>12.6</version>
Copy link
Member

Choose a reason for hiding this comment

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

Revert this change:

Suggested change
<version>12.6</version>
<version>12.5</version>

@ExtendWith(KiwiTcmsExtension.class)
public class KiwiJsonRpcClientTest {
@Test
@TcmsTestCaseId(11)
Copy link
Member

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:

Suggested change
@TcmsTestCaseId(11)
@TcmsTestCaseId(11) // optional

public @interface TcmsTestCaseId
{
int value();
}
Copy link
Member

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 ?

Copy link
Member

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.

}
}

public TestCase getTestCaseById(int testCaseId) {
Copy link
Member

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.

@Angelthree95
Copy link
Contributor Author

I extended this PR by some in here #348. Added all of your comments @atodorov. Closing this as outdated.

@atodorov atodorov reopened this Sep 1, 2023
@atodorov
Copy link
Member

atodorov commented Sep 1, 2023

I will review this one first, before reviewing the extended version.

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