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

Vladimir Sitnikov commented on DRILL-7025:
------------------------------------------

[~vitalii], [~ben-zvi], here's how I open the project.

1) IntelliJ IDEA 2019.1 EAP
 2) File -> Open
 3) Chose root {{pom.xml}}
 4) Open as project
 5) When the project loads, "template" JUnit run configuration has 
"/Users/vladimirsitnikov/Documents/work/drill" for "working directory"

For instance, I have {{$PROJECT_DIR$}} in 
/Users/vladimirsitnikov/Documents/work/drill/.idea/workspace.xml
{code:xml}
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <option name="TEST_OBJECT" value="class" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="moduleWithDependencies" />
      </option>
      <method v="2">
        <option name="Make" enabled="true" />
      </method>
    </configuration>{code}
I did try to delete {{.idea}} folder, and it changes [nothing, absolutely 
nothing|https://youtu.be/riwKuKSbFDs?t=101].

 

I don't really remember where $PROJECT_DIR$ comes from, however it is present 
even in 
/Users/vladimirsitnikov/Library/Preferences/IntelliJIdea13/options/project.default.xml
 (which dates back to 2015)

 

It looks like it should use 
[MODULE_WORKING_DIR|https://github.com/JetBrains/intellij-community/blob/831cc2982f9e9d290337c775a3a9c737920c240d/plugins/junit/src/com/intellij/execution/junit/JUnitConfiguration.java#L610]
 there (see 
[https://blog.jetbrains.com/idea/2018/05/intellij-idea-2018-1-4-is-released/] )

> Running Drill unit tests from within IntelliJ IDEA fails with 
> FileNotFoundException: Source './src/test/resources/tpchmulti' does not exist
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-7025
>                 URL: https://issues.apache.org/jira/browse/DRILL-7025
>             Project: Apache Drill
>          Issue Type: Bug
>          Components:  Server, Tools, Build &amp; Test
>    Affects Versions: 1.15.0
>            Reporter: Vladimir Sitnikov
>            Priority: Major
>
> I start org.apache.drill.TestExampleQueries via regular "run tests" button, 
> and it produces the following exception:
> {noformat}
> java.lang.RuntimeException: This should not happen
> at 
> org.apache.drill.test.BaseDirTestWatcher.copyTo(BaseDirTestWatcher.java:298)
> at 
> org.apache.drill.test.BaseDirTestWatcher.copyResourceToRoot(BaseDirTestWatcher.java:223)
> at 
> org.apache.drill.TestExampleQueries.setupTestFiles(TestExampleQueries.java:42)
> Caused by: java.io.FileNotFoundException: Source 
> './src/test/resources/tpchmulti' does not exist
> at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1074)
> at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038)
> at 
> org.apache.drill.test.BaseDirTestWatcher.copyTo(BaseDirTestWatcher.java:296)
> ... 2 more{noformat}
> In fact IDEA creates "run configuration" that uses 
> "/Users/vladimirsitnikov/Documents/work/drill" as "Working directory".
> That directory is a root where all drill sources are located (i.e. I have 
> /Users/vladimirsitnikov/Documents/work/drill/exec, 
> /Users/vladimirsitnikov/Documents/work/drill/exec/java-exec and so on).
> It looks like java-exec tests assume working directory is set to 
> /Users/vladimirsitnikov/Documents/work/drill/exec/java-exec, however it is 
> not the case when individual tests are run.
> The workaround is to add "exec/java-exec" to "working directory".
> It would be so much better if tests could be run from both working 
> directories.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to