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
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
079aa8a
to
3a27bc7
Compare
There was a problem hiding this 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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
.
LGTM! +1. |
… set by default DRILL-5751: Changes after code review. close apache#927
+1 |
… set by default
Please refer to DRILL-5751 for details.