-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-22382 Refactor tests in TestFromClientSide #385
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
Conversation
|
retest build |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
| public void testNull() throws Exception { | ||
| final TableName tableName = TableName.valueOf(name.getMethodName()); | ||
|
|
||
| public void testNull_TableName() { |
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.
testNullTableName? I thought we should keep use Camel-Case for method name.
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.
Sure. I'll fix them.
| } | ||
|
|
||
| @Test | ||
| public void testNull_FamilyName() { |
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.
Ditto. Please update other methods' name too. Thanks.
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
| try { | ||
| TEST_UTIL.createTable((TableName)null, FAMILY); | ||
| fail("Creating a table with null name passed, should have failed"); | ||
| } catch(Exception e) {} |
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.
Since we have split the method, we can use the @test(expected = XXXException.class) so we do not need to catch the exception any more?
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.
Right. Makes perfect sense.
| assertEmptyResult(result); | ||
|
|
||
| } catch (Exception e) { | ||
| throw new IOException("Using a row with null qualifier threw exception, should "); |
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.
Not your fault but since this is a refactoring, let's fix the 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.
Sure, fixed.
| } | ||
|
|
||
| @Test | ||
| @SuppressWarnings("checkstyle:MethodLength") |
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.
Maybe in the future we will also split these methods so let's do not suppress the warning?
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.
I tried to do so. But it seems to me that these tests are doing a sequence of operations which cannot be broken without doing a lot of redundant initialisation logic. I believe that the gain of making these tests smaller doesn't overcome the hit on the efficiency.
To be honest, checkstyle rule for maximizing the size of integration tests doesn't make sense to me.
| } | ||
|
|
||
| @Test | ||
| @SuppressWarnings("checkstyle:MethodLength") |
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.
Ditto.
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@Apache9 It's done and the build is green again. PTAL. |
|
My comments are still not resolved? |
…ption, fixed language
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.
+1.
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
Signed-off-by: Duo Zhang <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit dcc2c4d) Change-Id: I771e7713240700a47a55fdb743efc1e184c51856
testNull()into multiple,testVersionLimits()- cannot split,testDeletesWithReverseScan()- cannot split