Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 802A111329 for ; Sun, 6 Apr 2014 18:39:22 +0000 (UTC) Received: (qmail 39266 invoked by uid 500); 6 Apr 2014 18:39:18 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 39089 invoked by uid 500); 6 Apr 2014 18:39:16 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 39020 invoked by uid 99); 6 Apr 2014 18:39:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Apr 2014 18:39:15 +0000 Date: Sun, 6 Apr 2014 18:39:15 +0000 (UTC) From: "jay vyas (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HADOOP-10461) Runtime HCFS injector for FileSystem tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-10461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] jay vyas updated HADOOP-10461: ------------------------------ Description: Currently alot of manual inheritance and stub classes are required in order to run the FileSystemBaseContract and FSMainOperations tests. This means that the HCFS Test suite for any given FileSystem spans many classes, and makes it confusing and cumbersome for anyone to create new tests for a file system, and also very hard to audit and update the tests for a particular file system. If each FileSystem had a single point of entry for its tests, we would be much better off. *** There are two ways to do this. *** 1) Have a folder or package for each file system (i.e. .//hadoop-common/src/test/java/org/apache/hadoop/fs/rawlocal ) Or 2) Wrap all the HCFS Test implementation classes into a single class (i.e. RawLocalFileSystemHCFSTestSuite.java). *** The purpose of this JIRA is to implement (2) for the RawLocalFileSystem. This will cleanup the RawLocalFileSystem tests while providing other HCFS implementors a template they can use for their own filesystems (i.e. they can just copy the code and customize it however they want). *** For example: This is a sampling of the classes necessary to glue Local FS implementations into the Existing generic FileSystem test classes: {noformat} .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFcLocalFsPermission.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFcLocalFsUtil.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalDirAllocator.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystemPermission.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFsFCStatistics.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSFileContextCreateMkdir.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFS.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFSFileContext.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFSFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcCreateMkdirLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcMainOperationsLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcPermissionsLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFSMainOperationsLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemWithAuthorityLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsWithAuthorityLocalFs.java {noformat} Lets wrap these tests into a Suite for the RawLocalFileSystem, such that any once can copy that suite to build tests for their own file system. Using the "Enclosed" Junit (http://junit-team.github.io/junit/javadoc/4.10/org/junit/experimental/runners/Enclosed.html ) class, we can combine all of the RawLocalFileSystem tests into a single class. That way 1) Injects the file system at runtime. 2) Can easily be adopted for other FileSystems. 3) Can read in System properties to skip certain tests , thus providing support for the type of variability that we know FileSystem tests require. These can then be used to implement the semantics of HADOOP-9361. Ideally, we could replace RawLocalFileSystem tests with this injector as a second follow up patch to this, it would reduce the overall amount of code required, probably. was: Currently alot of manual inheritance and stub classes are required in order to run the FileSystemBaseContract and FSMainOperations tests. For example: This is a sampling of the classes necessary to glue Local FS implementations into the Existing generic FileSystem test classes: {noformat} .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFcLocalFsPermission.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFcLocalFsUtil.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalDirAllocator.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystemPermission.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFsFCStatistics.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSFileContextCreateMkdir.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFS.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFSFileContext.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFSFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcCreateMkdirLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcMainOperationsLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcPermissionsLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFSMainOperationsLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemWithAuthorityLocalFileSystem.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsLocalFs.java .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsWithAuthorityLocalFs.java {noformat} Lets provide a Guice or other DI based injector for HCFS tests which 1) Injects the file system at runtime. 2) Can easily be adopted for other FileSystems. 3) Can read in System properties to skip certain tests , thus providing support for the type of variability that we know FileSystem tests require. These can then be used to implement the semantics of HADOOP-9361. Ideally, we could replace RawLocalFileSystem tests with this injector as a second follow up patch to this, it would reduce the overall amount of code required, probably. > Runtime HCFS injector for FileSystem tests > ------------------------------------------ > > Key: HADOOP-10461 > URL: https://issues.apache.org/jira/browse/HADOOP-10461 > Project: Hadoop Common > Issue Type: Bug > Reporter: jay vyas > Priority: Minor > > Currently alot of manual inheritance and stub classes are required in order to run the FileSystemBaseContract and FSMainOperations tests. This means that the HCFS Test suite for any given FileSystem spans many classes, and makes it confusing and cumbersome for anyone to create new tests for a file system, and also very hard to audit and update the tests for a particular file system. > If each FileSystem had a single point of entry for its tests, we would be much better off. > *** There are two ways to do this. *** > 1) Have a folder or package for each file system (i.e. .//hadoop-common/src/test/java/org/apache/hadoop/fs/rawlocal ) Or > 2) Wrap all the HCFS Test implementation classes into a single class (i.e. RawLocalFileSystemHCFSTestSuite.java). > *** The purpose of this JIRA is to implement (2) for the RawLocalFileSystem. This will cleanup the RawLocalFileSystem tests while providing other HCFS implementors a template they can use for their own filesystems (i.e. they can just copy the code and customize it however they want). *** > For example: This is a sampling of the classes necessary to glue Local FS implementations into the Existing generic FileSystem test classes: > {noformat} > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFcLocalFsPermission.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFcLocalFsUtil.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestFSMainOperationsLocalFileSystem.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalDirAllocator.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystem.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFileSystemPermission.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFsFCStatistics.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSFileContextCreateMkdir.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestLocalFSFileContextMainOperations.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFS.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFSFileContext.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/TestSymlinkLocalFSFileSystem.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcCreateMkdirLocalFs.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcMainOperationsLocalFs.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFcPermissionsLocalFs.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestFSMainOperationsLocalFileSystem.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemLocalFileSystem.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFileSystemWithAuthorityLocalFileSystem.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsLocalFs.java > .//hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/TestViewFsWithAuthorityLocalFs.java > {noformat} > Lets wrap these tests into a Suite for the RawLocalFileSystem, such that any once can copy that suite to build tests for their own file system. > Using the "Enclosed" Junit (http://junit-team.github.io/junit/javadoc/4.10/org/junit/experimental/runners/Enclosed.html ) class, we can combine all of the RawLocalFileSystem tests into a single class. That way > 1) Injects the file system at runtime. > 2) Can easily be adopted for other FileSystems. > 3) Can read in System properties to skip certain tests , thus providing support for the type of variability that we know FileSystem tests require. These can then be used to implement the semantics of HADOOP-9361. > Ideally, we could replace RawLocalFileSystem tests with this injector as a second follow up patch to this, it would reduce the overall amount of code required, probably. -- This message was sent by Atlassian JIRA (v6.2#6252)