jeudi 8 janvier 2015

GRAILS 2.4.4: how to run unit tests only, or how to fix the generated integration tests?

With grails 2.4, when you create a controller for example, it creates a unit test class such as:



@TestFor(SessionService)
class SessionServiceSpec extends Specification {

def setup() {
}

def cleanup() {
}

void "test something"() {
}
}


so you create 20 controllers, and get 20 test classes.


When you try to run grails test-app, it fails with the following error:


java.lang.Exception: No tests found matching grails test target pattern filter from org.junit.runner.Request


It never gets to run our integration tests.


So tests grails creates for you do not work out of the box.


We could delete all the created test specs classes, but then we kind of want them there ready for if we want to write them.



  1. is there a way to run our integration tests, without running the unit tests (which are broken) or:

  2. is there a way to fix the test so they dont fall over? Someone posted add a valid when/then, but we dont know what to put in this, as what we have tried still generates the same exceptions.


Its a shame grails doesn't tell you which tests or class throws this exception.


Aucun commentaire:

Enregistrer un commentaire