Search code examples
unit-testinggrailsintellij-ideaspockgrails-2.5

How to run all unit tests for Grails app with multi private plugins


My project includes several private plugins (modules) with unit tests. I tried to run tests in main directory and in plugin's using a grails test-app, but the script only find tests in main project. Plugins have across dependencies. Which command/script should I use to execute all tests in main project and in private plugins(modules)?

Grails 2.5 IntelliJ IDEA 14.1.5


Solution

  • Unit tests in your Grails application are targeted to test the code of your web application but not the code of the plugins your web application uses.

    If you want to test the code of your plugin you need to implement a unit test in the plugins project folder.

    If you want to test the interaction of your web application with the included plugins you need to implement an integration test and test your Grails artefact (controller, service, ..) and verify the interaction.