jdaugherty opened a new issue, #345:
URL: https://github.com/apache/grails-intellij-plugin/issues/345

   ### Steps to reproduce
   
   Add an environment variable to a Grails test run configuration.
   
   I'm running Ubuntu 18.04 with Java installed with SDKMAN!.
   
   ### Expected behaviour
   
   Tests are executed. The environment variable is available in the application 
under test (with correct value).
   
   ### Actual behaviour
   ```
   Testing started at 14:50 ...
   
/home/<hidden-personal-data>/rreitzig/.sdkman/candidates/java/8.0.181-oracle/bin/java
 
-Dgrails.home=/home/<hidden-personal-data>/rreitzig/.sdkman/candidates/grails/2.5.6
 
-Dtools.jar=/home/<hidden-personal-data>/rreitzig/.sdkman/candidates/java/8.0.181-oracle/lib/tools.jar
 
-Dgroovy.starter.conf=/home/<hidden-personal-data>/rreitzig/.sdkman/candidates/grails/2.5.6/conf/groovy-starter.conf
 -ea -Dbase.dir=/home/<hidden-personal-data>/rreitzig/Code/hds-webapp 
-Dgrails.build.listeners=org.jetbrains.groovy.grails.rt.GrailsIdeaTestListener 
-Dfile.encoding=UTF-8 -classpath 
/home/<hidden-personal-data>/rreitzig/.sdkman/candidates/grails/2.5.6/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-2.4.10.jar:/home/<hidden-personal-data>/rreitzig/.sdkman/candidates/grails/2.5.6/dist/grails-bootstrap-2.5.6.jar
 org.codehaus.groovy.grails.cli.support.GrailsStarter --classpath 
/home/<hidden-personal-data>/rreitzig/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/183.5429.30/plugins/Grails/lib/grails-r
 t.jar --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf 
/home/<hidden-personal-data>/rreitzig/.sdkman/candidates/grails/2.5.6/conf/groovy-starter.conf
 "test-app functional: -plain-output"
   |Loading Grails 2.5.6
   |Configuring classpath
   .
   |Environment set to test
   .......................
   |Compiling 2 source files
   
   .................................................
   |Running Grails application
   Error |
   Exception in thread "Thread-4"
   Error |
   java.io.IOException: Cannot run program "java" (in directory 
"/home/<hidden-personal-data>/rreitzig/Code/hds-webapp"): error=2, No such file 
or directory
   Error |
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
   Error |
        at 
org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.fork(ForkedGrailsProcess.groovy:309)
   Error |
        at 
org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.fork(ForkedGrailsProcess.groovy:264)
   Error |
        at 
org.grails.plugins.tomcat.fork.ForkedTomcatServer$_startSecure_closure6.doCall(ForkedTomcatServer.groovy:171)
   Error |
        at 
org.grails.plugins.tomcat.fork.ForkedTomcatServer$_startSecure_closure6.call(ForkedTomcatServer.groovy)
   Error |
        at groovy.lang.Closure.run(Closure.java:495)
   Error |
        at java.lang.Thread.run(Thread.java:748)
   Error |
   Caused by: java.io.IOException: error=2, No such file or directory
   Error |
        at java.lang.UNIXProcess.forkAndExec(Native Method)
   Error |
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
   Error |
        at java.lang.ProcessImpl.start(ProcessImpl.java:134)
   Error |
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
   Error |
        ... 6 more
   
   Process finished with exit code 130 (interrupted by signal 2: SIGINT)
   ```
   Also, the tool window doesn't pick up on the failure and keeps spinning.
   
   This is with and without "Include parent environment variables" selected.
   The parent environment does not include any SDKMAN! variables; that is 
expected if IDEA is started through a launcher, not a shell. While it's 
certainly the case that the `java` executable is only on the PATH if the bash 
initialization script of SDKMAN! has been run for the current shell, unmodified 
run configurations work just fine.
   
   ---
   
   *Imported from 
[IDEA-207244](https://youtrack.jetbrains.com/issue/IDEA-207244) · Type: Bug · 
Votes: 0*
   *Comments, attachments, dates and reporter are not part of the export — 
follow the link above for the full history.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to