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

Chris Nauroth commented on HADOOP-13446:
----------------------------------------

Steve and Aaron, thank you for your reviews.  I plan to commit this later.

bq. How does mvn verify differ from mvn integration-test, which is what I've 
had an alias for integration testing in the past?

There is some information on this in the Maven documentation on [Introduction 
to the Build 
Lifecycle|https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html],
 in particular the "Lifecycle Reference" and the section on "Some Phases Are 
Not Usually Called From the Command Line".  The integration testing workflow is 
different from the unit testing workflow in that there are additional phases 
guaranteed to execute before and after: pre-integration-test, integration-test, 
post-integration-test and verify.  Typically, pre-integration-test is used for 
external environment bootstrapping (e.g. start a web server), integration-test 
runs the tests, post-integration-test tears down the external environment (e.g. 
stop a web server) and verify is used for post-testing analysis (e.g. code 
coverage tools like Cobertura).

For what I've implemented here in hadoop-aws, we're not really doing anything 
in those additional phases.  In practice, there won't really be much difference 
between running integration-test vs. verify.  Still, running verify is the 
standard practice, so I chose to document it that way.  In theory, we could 
take advantage of those additional phases someday, such as automatic test 
bucket creation and deletion in pre-integration-test and post-integration-test. 
 We might even be able to do fancy post-validation work by binding custom 
actions to verify that check test results for your new performance metrics and 
plot them.

bq. with this patch, hadoop-aws unit tests will always run —its now only the IT 
tests which are skipped if there's no auth-keys.xml. Correct?

Yes, that is correct.  You can see which tests Jenkins ran in the last 
pre-commit test report:

https://builds.apache.org/job/PreCommit-HADOOP-Build/10315/testReport/

Admittedly, this is not very much, but it's a start.

I do not see this ever replacing our policy to run all integration tests before 
contributing or committing a patch, because there is too much risk that 
mock-based tests don't accurately simulate integration with the real service.

> Support running isolated unit tests separate from AWS integration tests.
> ------------------------------------------------------------------------
>
>                 Key: HADOOP-13446
>                 URL: https://issues.apache.org/jira/browse/HADOOP-13446
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-13446-HADOOP-13345.001.patch, 
> HADOOP-13446-HADOOP-13345.002.patch, HADOOP-13446-HADOOP-13345.003.patch, 
> HADOOP-13446.004.patch, HADOOP-13446.005.patch
>
>
> Currently, the hadoop-aws module only runs Surefire if AWS credentials have 
> been configured.  This implies that all tests must run integrated with the 
> AWS back-end.  It also means that no tests run as part of ASF pre-commit.  
> This issue proposes for the hadoop-aws module to support running isolated 
> unit tests without integrating with AWS.  This will benefit S3Guard, because 
> we expect the need for isolated mock-based testing to simulate eventual 
> consistency behavior.  It also benefits hadoop-aws in general by allowing 
> pre-commit to do something more valuable.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to