Since 2019.2 run configuration working directory is not saved

Answered

I have a scala sbt project using scalatest. This project uses sub-projects and has both Test and IntegrationTest configurations.

There was an already existing difference between IntelliJ's and sbt's default behavior regarding sub-project tests. In sbt, by default, the working directory of a sub-project test is the base directory *of the sub-module*, but with IntelliJ, when I run a test (for example, by right-clicking the class and selecting Run ...), the working directory defaults to the root of the project.

^This was annoying previously, but I could work around it by editing the run configuration for that test class and adding the sub-project's directory to the working directory path.  However, since upgrading to 2019.2, IntelliJ is not remembering my change to the working directory. I make a change to the working directory, then hit OK (also tried Apply, then OK) and run my test again, I get the same error that indicates the working directory is at the main project root rather than sub-project root. When I open the run configuration again, the working directory has reverted to the main project root again.

This is what the config looks like by default, and how it reverts upon re-opening:

And this is the change I made to try to set the working directory. Note '/server' is appended to the working directory. This is what worked to allow the test to run in previous IntelliJ versions:

I have tried destroying the .idea folder on this project, removing the project from my recents list and reloading the project. That made no change.

2

Please sign in to leave a comment.