maiflai/gradle-scalatest

intellij: 'Test events were not received'

tlengyel opened this issue · 4 comments

I am running my unit tests from within intellij using the gradle-pane: Tasks->verification->test

Previously, when using JUnitRunner annotation, the intellij test-pane would show a list of tests and their status. Now, having removed the annotation and adjusted the build.gradle to use maiflai, the tests run (textual output shows in the test-pane console), but the only thing in the test-pane status area is the message 'Test events were not received'

Advice?

Top level build.gradle is empty.
settings.gradle:

pluginManagement {
    repositories {
            maven {
                    url uri('http://SANITIZED/repo/')
            }
    }
}
rootProject.name = 'watery'
include 'modules/tart'

Module level build.gradle:

plugins {
    // Apply the scala plugin to add support for Scala
    id 'scala'
    id 'com.github.maiflai.scalatest' version '0.22'
}

dependencies {
    // Use Scala 2.11 in our library project
    compile 'org.scala-lang:scala-library:2.11.8'
    // Use Scalatest for testing our library
    testCompile 'junit:junit:4.12'
    testCompile 'org.scalatest:scalatest_2.11:3.0.4'
    // Need scala-xml at test runtime
    testRuntime 'org.scala-lang.modules:scala-xml_2.11:1.0.6'
    testRuntime 'org.pegdown:pegdown:1.4.2'
}

// In this section you declare where to find the dependencies of your project
repositories {
    // Use jcenter for resolving your dependencies.
    // You can declare any Maven/Ivy/file repository here.
    jcenter()
}

test {
    dependsOn 'cleanTest'
    //Your previous task details (if any)
}

Sorry, I think this is expected. The plugin does not fully integrate with the Gradle test framework.

To avoid this, I've switched back to using IntelliJ to run tests for now: Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle -> Run tests using -> Default (Intellij IDEA)

atais commented

@tekumara nice workaround! Thanks 👍

@maiflai do you know what would be necessary to provide such integration?

I recommend using https://github.com/helmethair-co/scalatest-junit-runner if you want this to work with IDEA