Grails 3/Gradle/IntelliJ and integration tests

911 views
Skip to first unread message

Bud Byrd

unread,
Apr 6, 2015, 10:18:16 AM4/6/15
to grails-de...@googlegroups.com
It seems I'm having problems kicking off integration tests via Gradle.  I am migrating a plugin to 3.x, and have placed my integration tests in src/integration-test/groovy, and modified the existing integration tests as necessary.  Using gradle test, I can only get unit tests to run.  This is true using both IntelliJ and the command line.

The only way I can get integration tests to run is via the command line using grails test-app.  The odd thing is, using the same command in IntelliJ gives me an error: Task 'cleanGrails-test-app' not found in root project.

I'm using an unmodified build.gradle.  Am I doing something wrong or missing something?

Jeff Scott Brown

unread,
Apr 6, 2015, 10:46:01 AM4/6/15
to grails-de...@googlegroups.com
I think the integration tests should run if you execute "./gradlew check". You can also run them by themselves with"./gradlew integrationTest" (or ./gradlew iT for short). 



JSB

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/f39cd700-4e1d-47bf-8df1-1591993d90ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nobeans

unread,
Apr 6, 2015, 10:52:56 AM4/6/15
to grails-de...@googlegroups.com
You can use 'check' or 'integrationTest' as Jeff says. 

Note that currently the test report directory both of 'test' and 'integrationTest' are same. So, if you run two tasks sequentially as 'gradle test integrationTest', the 'test' task's report would be overwritten.


For more options, visit https://groups.google.com/d/optout.



--
Yasuharu Nakano

Aaron

unread,
Oct 22, 2015, 10:59:17 AM10/22/15
to Grails Dev Discuss
This is kind of old, but I came across this as well while porting build-test-data.

The problem isn't running the integration tests, per se, but rather that IntelliJ seems to only 'understand' that it's running tests when you specifically run the 'test' task. That's the only time it shows the test runner interface for me (maybe there's some way to make other tasks be 'test runner' enabled, not sure).

I'm sure there's a better solution, but I was able to trick IntelliJ by renaming the test task to unitTest and then creating a new test task that runs both. This seems to run both in the test runner interface (for me).

def testTask = tasks.test
tasks.remove(testTask)
testTask.name = "unitTest"
tasks.add(testTask)

task test(dependsOn:['unitTest', 'integrationTest'])

On Monday, April 6, 2015 at 10:52:56 AM UTC-4, Yasuharu Nakano wrote:
You can use 'check' or 'integrationTest' as Jeff says. 

Note that currently the test report directory both of 'test' and 'integrationTest' are same. So, if you run two tasks sequentially as 'gradle test integrationTest', the 'test' task's report would be overwritten.
On Mon, Apr 6, 2015 at 11:45 PM, Jeff Scott Brown <je...@jeffandbetsy.net> wrote:
I think the integration tests should run if you execute "./gradlew check". You can also run them by themselves with"./gradlew integrationTest" (or ./gradlew iT for short). 



JSB

Sent from my iPhone

On Apr 6, 2015, at 9:18 AM, Bud Byrd <bud....@gmail.com> wrote:

It seems I'm having problems kicking off integration tests via Gradle.  I am migrating a plugin to 3.x, and have placed my integration tests in src/integration-test/groovy, and modified the existing integration tests as necessary.  Using gradle test, I can only get unit tests to run.  This is true using both IntelliJ and the command line.

The only way I can get integration tests to run is via the command line using grails test-app.  The odd thing is, using the same command in IntelliJ gives me an error: Task 'cleanGrails-test-app' not found in root project.

I'm using an unmodified build.gradle.  Am I doing something wrong or missing something?

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.

To post to this group, send email to grails-de...@googlegroups.com.



--
Yasuharu Nakano

Zachary Klein

unread,
Nov 9, 2015, 9:58:54 PM11/9/15
to Grails Dev Discuss
Hey Aaron, sounds like you're solving the same issue I'm trying to solve. Would you mind clarifying where you're defining the new task? I don't see task definitions in my project - its that part of the Grails distribution?

Thanks!
Zak
Reply all
Reply to author
Forward
0 new messages