You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by "Sravya Tirukkovalur (JIRA)" <ji...@apache.org> on 2015/08/13 19:55:47 UTC

[jira] [Commented] (SENTRY-836) Refactor test TestDatabaseProvider.java: make each test case independent from other tests, not assume any external states/data

    [ https://issues.apache.org/jira/browse/SENTRY-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695657#comment-14695657 ] 

Sravya Tirukkovalur commented on SENTRY-836:
--------------------------------------------

Does it make sense to change clearAll() in AbstractTestWithStaticConfiguration to loop over all databases and delete them after each test? So that we do not have to trust the contributor to clean up for us? And future tests which try to depend on state created by other tests would fail before it gets committed. 

> Refactor test TestDatabaseProvider.java: make each test case independent from other tests, not assume any external states/data
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SENTRY-836
>                 URL: https://issues.apache.org/jira/browse/SENTRY-836
>             Project: Sentry
>          Issue Type: Bug
>            Reporter: Anne Yu
>
> Ideally tests should be independent from each other, not assume any external state/test data pre-exist on test environments. It helps setup before each test and clean up after each test using a method from base test class.
> If the same data has to be present for each test, maybe put it into Before then clean up in After.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)