You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Ruiming Zhou (JIRA)" <ji...@apache.org> on 2016/11/29 23:40:59 UTC
[jira] [Comment Edited] (SENTRY-1502) Multiple tests in
TestSentryStore are not testing useful things
[ https://issues.apache.org/jira/browse/SENTRY-1502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15706936#comment-15706936 ]
Ruiming Zhou edited comment on SENTRY-1502 at 11/29/16 11:40 PM:
-----------------------------------------------------------------
i can work this issue. should I assign to myself ?
was (Author: skyapus@yahoo.com):
i can work this issue.
> 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, sentry-ha-redesign
> Reporter: Alexander Kolbasov
>
> 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
(v6.3.4#6332)