Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7025

Running Drill unit tests from within IntelliJ IDEA fails with FileNotFoundException: Source './src/test/resources/tpchmulti' does not exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 1.15.0
    • None
    • None

    Description

      I start org.apache.drill.TestExampleQueries via regular "run tests" button, and it produces the following exception:

      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

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            vladimirsitnikov Vladimir Sitnikov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: