Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-5751: Fix unit tests to use local file system even if it is not… #927

Closed
wants to merge 2 commits into from

Conversation

arina-ielchiieva
Copy link
Member

… set by default

Please refer to DRILL-5751 for details.

Copy link
Member

@vvysotskyi vvysotskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a couple of minor comments, overall looks good to me. +1

@@ -120,8 +132,11 @@ public void testDisableDynamicSupport() throws Exception {
@Test
public void testAbsentBinaryInStaging() throws Exception {
Path staging = getDrillbitContext().getRemoteFunctionRegistry().getStagingArea();
FileSystem fs = getDrillbitContext().getRemoteFunctionRegistry().getFs();
copyJar(fs, jars, staging, default_binary_name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that a source file should be copied here instead of the binary file, since test checks that binary file is missing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

fs = FileSystem.get(new Configuration());
Configuration configuration = new Configuration();
configuration.set(FileSystem.FS_DEFAULT_NAME_KEY, FileSystem.DEFAULT_FS);
fs = FileSystem.get(configuration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three lines appear several times in the code, so may be it would be better to create a static method which returns FileSystem instance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Added static method ExecTest.getLocalFileSystem.

Copy link
Member Author

@arina-ielchiieva arina-ielchiieva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vvysotskyi thanks for code review. Addressed code review comments in new commit.

@@ -120,8 +132,11 @@ public void testDisableDynamicSupport() throws Exception {
@Test
public void testAbsentBinaryInStaging() throws Exception {
Path staging = getDrillbitContext().getRemoteFunctionRegistry().getStagingArea();
FileSystem fs = getDrillbitContext().getRemoteFunctionRegistry().getFs();
copyJar(fs, jars, staging, default_binary_name);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed.

fs = FileSystem.get(new Configuration());
Configuration configuration = new Configuration();
configuration.set(FileSystem.FS_DEFAULT_NAME_KEY, FileSystem.DEFAULT_FS);
fs = FileSystem.get(configuration);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Added static method ExecTest.getLocalFileSystem.

@vvysotskyi
Copy link
Member

LGTM! +1.

amansinha100 pushed a commit to amansinha100/drill that referenced this pull request Sep 2, 2017
… set by default

DRILL-5751: Changes after code review.

close apache#927
@amansinha100
Copy link

+1

@asfgit asfgit closed this in 75c3513 Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants