Search code examples
scalaintellij-ideascalatest

Intellij is not providing either popup or menu options to run a scalatest created by Intellij itself


I am uncertain why a given scala project is not being identified as scalatest - capable/ready..

Actually it has been possible to generate new ScalaTest's by hitting the Shift-Command-T . But then I can not run them..

enter image description here

The dialog shows that ScalaTest is healthy:

enter image description here

And a correct ScalaTest-ready class is generated:

import org.scalatest.FunSuite

class MetricUtilsTest extends FunSuite {

  test("testF") {

  }

  test("testError") {

  }

}

However there is no popup or menu option to allow to run/debug the test from within IJ:

enter image description here

Things I have tried

  • Delete the Intellij project and start from scratch
  • Multiple different test suites (none are able to be run)

Note that the newly created test does run from command line (which shows us the maven project is healthy):

 mvn exec:java -Dexec.mainClass=com/blazedb/spark/MetricUtilsTest.scala -Dexec.args=""

Update I am able to manually set up a Run Configuration for the newly created test and run the test successfully.

enter image description here

So.. what is going on with the popup menu not working here ? I am on Ultimate 2019.1 .


Solution

  • Found it! Somehow the following (non default I presume?) setting got selected:

    enter image description here

    I do not ever use gradle so not sure how/when that got set.. The obvious fix is to reset this to Platform Test Runner :

    enter image description here

    And voila' we're back to the expected pop-up dialog including the options to Run/Debug current scalatest :

    enter image description here

    Note that this problem was diagnosed by using the Actions search dialog (shift-command-A) and typing "Run Test"