[ https://issues.apache.org/jira/browse/SENTRY-1502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613786#comment-16613786 ]
Hadoop QA commented on SENTRY-1502: ----------------------------------- Here are the results of testing the latest attachment https://issues.apache.org/jira/secure/attachment/12842223/SENTRY-1502.001.patch against master. {color:red}Overall:{color} -1 due to an error {color:red}ERROR:{color} failed to apply patch (exit code 1): error: a/sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java: does not exist in index error: patch failed: sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java:19 Falling back to three-way merge... Applied patch to 'sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java' with conflicts. Going to apply patch with: git apply -p1 error: patch failed: sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java:19 Falling back to three-way merge... Applied patch to 'sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java' with conflicts. U sentry-service/sentry-service-server/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java Console output: https://builds.apache.org/job/PreCommit-SENTRY-Build/4112/console This message is automatically generated. > Multiple tests in TestSentryStore are not testing useful things > --------------------------------------------------------------- > > Key: SENTRY-1502 > URL: https://issues.apache.org/jira/browse/SENTRY-1502 > Project: Sentry > Issue Type: Test > Components: Sentry > Affects Versions: 1.7.0, 2.0.0 > Reporter: Alexander Kolbasov > Assignee: Ruiming Zhou > Priority: Major > Labels: patch > Attachments: SENTRY-1502.001.patch > > > I noticed that multiple unit tests in TestSentryStore are not testing useful > things. For example: > {code} > @Test > public void testCreateDropRole() throws Exception { > String roleName = "test-drop-role"; > long seqId = sentryStore.createSentryRole(roleName).getSequenceId(); > assertEquals(seqId + 1, > sentryStore.dropSentryRole(roleName).getSequenceId()); > } > {code} > So this code only tests that there are no exceptions thrown. The assert is > bogus - it tests that there was a single transaction in between which is a > wrong test in the first place - number of transactions isn't a functionality. > The test doesn't verify whether the role was actually created and whether it > was correctly dropped. And it is similar for other tests as well. -- This message was sent by Atlassian JIRA (v7.6.3#76005)