-
Notifications
You must be signed in to change notification settings - Fork 993
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
PHOENIX-5230 Fix ChangePermissionsIT and TableDDLPermissionIT on master #477
Conversation
import java.util.Set; | ||
|
||
import com.google.common.base.Joiner; | ||
import com.google.common.base.Throwables; | ||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; |
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.
Given the recent jira for logging, let's use org.slf4j.Logger
and org.slf4j.LoggerFactory.
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 be fixed by @yanxinyi in PHOENIX-5228
|
||
unprivilegedUser = User.createUserForTesting(configuration, "unprivilegedUser", new String[0]); | ||
@Before | ||
public void setUp() { |
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 would move this right after the constructor for better readability.
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.
doSetup is called even before the setup happens, is that correct? in that case ignore the comment.
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.
doSetup is called once per class, while setup is called before each test executes. I'll rename these.
public class BasePermissionsIT extends BaseTest { | ||
|
||
private static final Log LOG = LogFactory.getLog(BasePermissionsIT.class); | ||
|
||
static String SUPERUSER; | ||
static String SUPERUSER = System.getProperty("user.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.
nit: SUPER_USER
@swaroopak I uploaded a new PR based on your feedback, please review. |
import static org.junit.Assert.fail; | ||
|
||
@Category(NeedsOwnMiniClusterTest.class) | ||
@FixMethodOrder(MethodSorters.NAME_ASCENDING) |
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.
Why do we need to fix this order of execution for tests?
One question on the |
The test aTestRXPermsReqdForPhoenixConn in BasePermissionIT needs to be the very first test that is run |
@twdsilva is it possible to separate out the part that needs to be run first in |
aTestRXPermsReqdForPhoenixConn tests functionality that assumes it is the very first time a client connects to cluster. I don't think I can move this to BeforeClass.
|
@twdsilva I see. +1 |
@karanmehta93 @swaroopak Please review. I moved all the tests from ChangePermissionsIT, SystemTablePermissionsIT and TableDDLPermissionIT into BasePermissionsIT and created two subclasses one each for namespaces enabled/disabled. I only create a single minicluster for each class.