-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
YARN-10985. Add some tests to verify ACL behaviour in CapacitySchedulerConfiguration #3570
Conversation
🎊 +1 overall
This message was automatically generated. |
} | ||
|
||
@Test | ||
public void testSpecifiedEmptySubmitACLForRootIsNotInherited() { |
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 think this test scenario could be merged with the test beforehand. The empty root ACL and its inheritance property belongs together in my opinion.
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 do you mean? If I have to run those 3 assertions for a different queue path then I'd prefer to keep them in a separate method. The name of the testcase also tells more precisely what is the purpose.
} | ||
|
||
@Test | ||
public void testDefaultSubmitACLForRootChildNoneAllowed() { |
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.
Same for here. See comments below.
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.
Thanks for the patch @szilard-nemeth. I agree that we need these tests, however we already have a TestCapacitySchedulerQueueACLs test class. It seems odd to have a TestCSConfig class with only ACL tests in it. My opinion is that these tests could belong to TestCapacitySchedulerQueueACLs class instead.
Thanks @9uapaw for sharing your opinion.
My new test class (TestCapacitySchedulerConfiguration) is much lightweight and its purpose is to test the CapacitySchedulerConfiguration. The only reason it contains just ACL tests because there were no tests for this class, which is pretty much disappointing. |
f967e39
to
b2d027d
Compare
To my mind, TestCapacitySchedulerQueueACLs should have testcases which test the functionality of ACLs, like inheritance, groups / user based matching, etc. While the TestCapacitySchedulerConfiguration should test the configuration part, like parsing of different markups of configuration, defaults etc. So I think BOTH tests have merit, and the TestCapacitySchedulerConfiguration class should be extended with other tests, which test the configuration parsing and evaluation. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
Thanks @szilard-nemeth for your answers. I can agree to these arguments. I have two additions:
- The ordering of the tests should be revamped. I think the private internal methods should be at the bottom of the file, because it is hard to comprehend this test file at first.
- Could you also add a test case for multiple space ACLs as well? eg. a__b__? As space is the delimiter, I think it is important to cover it as well.
These are only nits, the patch looks good to me +1.
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.
@szilard-nemeth thank you for the patch, LGTM+1.
…erConfiguration (apache#3570). Contributed by Szilard Nemeth
…acitySchedulerConfiguration (apache#3570). Contributed by Szilard Nemeth (cherry picked from commit 2e32cc6) Change-Id: I1e4dc3defe02e761f5132e496fc49796510a6135
Description of PR
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?