-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to do integration test in a multi-project setup #102
Comments
Hi Mats, project(':ProjectA') {
farm {
project(':ProjectA')
}
}
project(':ProjectB') {
farm {
project(':ProjectB')
}
} you should change it into this: farm {
project(':ProjectA')
project(':ProjectB')
} When you invoke "farmIntegrationTest" on the first variant, web-server will be started/stopped before/after each web-app, which is slow. |
Do your projects contain farm definitions at all? |
A typical submodule would have a farm like this: farm {
webapp project
webapp ':webshop-car'
webapp ':webshop-customerservice'
webapp ':webshop-mock'
} While another submodule could have it like this: farm {
webapp ':webshop-customerservice'
webapp ':webshop-mock'
webapp ':webshop-policyservice'
webapp ':webshop-archiveservice'
webapp ':webshop-communicationservice'
webapp ':webshop-uwservice'
webapp ':webshop-animal'
} And the customer module have a farm like this: farm {
webapp ':webshop-mock'
webapp ':webshop-communicationservice'
webapp ':webshop-customerservice'
webapp ':webshop-uwservice'
} Is it possible to run all integration tests from all submodules with setting up and tearing down jetty only once? |
Ah, now it becomes clearer 😄 |
I have a solution for you. The solution is available in Gretty 1.1.5-SNAPSHOT (already at jfrog snapshot repository). apply plugin: 'org.akhikhl.gretty'
farm {
include ':ProjectA'
include ':ProjectB'
} now you have so-called "composite farm". ProjectA and ProjectB are supposed to contain their own farms. The composite farm includes webapps referenced by those farms. |
I can't find that version anywhere.. http://repo.jfrog.org/artifactory/webapp/search/artifact/?3&q=gretty |
It's in oss.jfrog.org: https://oss.jfrog.org/webapp/search/artifact/?1&q=gretty-1.1.5 :) |
Ah 😄 Now I get this: FAILURE: Build failed with an exception.
BUILD FAILED Total time: 27.247 secs |
I'll have a look. |
Looks like infinite recursion in farm includes. Could you, please, show the structure of your composite farm? Does it include itself? |
I introduced automatic detection of cyclic farm includes in Gretty 1.1.5-SNAPSHOT. |
Okey, now the root build file looks like this: farm {
include ':webshop-volvia-bsal'
} ...and the webshop-volvia-bsal submodule has a farm like this: farm {
webapp project
webapp ':webshop-car'
webapp ':webshop-customerservice'
webapp ':webshop-mock'
} And then the output was this: |
I should probably also add the farm from the webshop-animal module: farm {
webapp ':webshop-customerservice'
webapp ':webshop-mock'
webapp ':webshop-policyservice'
webapp ':webshop-archiveservice'
webapp ':webshop-communicationservice'
webapp ':webshop-uwservice'
webapp ':webshop-animal'
} |
I'll have a look. |
Are you sure you have it like this: farm {
webapp project
// ...
} and not like this? farm {
include project
// ...
} the second variant would produce exactly the error message you mentioned. |
I did a search for "include" on *.gradle files in the IDE, and it found two matches:
And no matches in submodule build.gradle files |
Understood. So there's no obvious error in configuration. |
Sorry for the late response here, I've been really busy with non-work stuff... So here is a minimalistic multiproject gradle project that gets the same error: https://github.com/fowlie/gretty-sample |
Yesss, with this project it is reproducible 😄 Thanks a lot. |
I solved the problem in Gretty 1.1.7-SNAPSHOT. |
Hi Mats, |
Hi! I guess we can close this now. Although we decided to do things slightly different and did not need this feature any more. That being said, I was voting for this feature though 😃 |
Hi,
We have a multi-project gradle build with 20 submodules. Each submodule has its own farm, and each farm shares a lot of common modules. So the _farmIntegrationTest_ task seems very inefficient, as it would start and stop the common modules many times.
Is it possible to call _farmStartWar, run all integration tests and then finally call _farmStopWar?
Thanks!
The text was updated successfully, but these errors were encountered: