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

Konstantin Boudnik commented on BIGTOP-1321:
--------------------------------------------

Thanks Martin. A couple of comments:
 - instead of introducing a whole new exception class I'd rather use 
{{assertEquals}} from the standard JUnit. Say this 
{code}
+    if (shHDFS.getRet() != 0) {
+      String err_out = StringUtils.join(shHDFS.getErr().toArray(), "\\n");
+      throw new TestCLISetupException("hadoop fs -mkdir of testcli dir failed: 
" + err_out);
+    }
{code}
would look like
{code}
    Assert.assertEquals("hadoop fs -mkdir of testcli dir failed: " + 
        StringUtils.join(shHDFS.getErr().toArray(), "\\n"), 0, shHDFS.getRet());
{code}
 - for {{   if (!"0".equals(conf.get("fs.trash.interval"))) }} do you think 
you'd be able to use {{conf.getInt("fs.trash.interval", 1) }} in combination 
with an assert?


> TestCLI: check assumptions before the test run
> ----------------------------------------------
>
>                 Key: BIGTOP-1321
>                 URL: https://issues.apache.org/jira/browse/BIGTOP-1321
>             Project: Bigtop
>          Issue Type: Improvement
>          Components: Tests
>    Affects Versions: 0.8.0
>            Reporter: Martin Bukatovic
>            Assignee: Martin Bukatovic
>            Priority: Minor
>         Attachments: BIGTOP-1321.1.patch
>
>
> The TestCLI test cases has some assumptions which are not checked in the test 
> code. This is a proposal to add checks for each important assumption which 
> would make some cases fail if not met. This would save us some debugging time 
> when setting up new test environment and would make this test easier to reuse.
> So far, I have identified these:
>  * the effective user must be hdfs (a root for HDFS)
>  * the HDFS trash feature must be disabled (`fs.trash.interval` should be 0)
>  * hdfs://tmp/testcli_TIMESTAMP directory has been really created
> I expect there are additional assumptions worth checking, any other ideas?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to