saladinkzn / gretty

Advanced gradle plugin for running web-apps on jetty and tomcat.
MIT License
2 stars 2 forks source link

Task - "integrationTest" always assumes, it needs to start tomcat before and stop after tests #10

Open mkornipati opened 8 years ago

mkornipati commented 8 years ago

This is same as created @ https://github.com/akhikhl/gretty/issues/244


I am referring to the "Gretty Configuration" and understood that the default value for integrationTestTask is integrationTest.

We got few projects where we don't need the Tomcat needs to be running for integrationTest Task. and actually name of the integrationTest task is integrationTest. I am looking for Gretty Configurations to see, if I can say, I don't need Tomcat start and stop for my "integrationTest" task. Can you point me to right configuration if any.

Here are few other observations. I tried setting the integrationTestTask as null or '', but I can still see the Tasks - appBeforeIntegrationTestand appAfterIntegrationTest getting executed. The reason seems to be because appBeforeIntegrationTest.integrationTestTaskAssigned, appAfterIntegrationTest.integrationTestTaskAssigned is alwaystrue and it is not updated to 'false' when I am updating value of integrationTestTask to null or empty string?

saladinkzn commented 8 years ago

Hello.

Do you set integration task to null in gretty configuration? Like:

gretty {
     integrationTestTask = null
}

What I see here, that there's a bug if you don't set integrationTestTask to null in Gretty configuration you actually get it used in AppBeforeIntegrationTestTask if none or falsy is assigned in it.

mkornipati commented 8 years ago

Yes @saladinkzn. As mentioned in the the description, I tried setting the integrationTestTask as nullor '' and both not worked.

saladinkzn commented 8 years ago

OK, I'll check it out today

2016-04-14 15:31 GMT+03:00 Mohan Kornipati notifications@github.com:

Yes @saladinkzn https://github.com/saladinkzn. As mentioned in the the description, I tried setting the integrationTestTask as nullor '' and both not worked.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/saladinkzn/gretty/issues/10#issuecomment-209915237

mkornipati commented 8 years ago

Thanks @saladinkzn and just to let you know, currently, as a workaround we are removing the appBeforeIntegrationTest from integrationTest.dependsOnand appAfterIntegrationTest from integrationTest.finalizedBy

     project.integrationTest.dependsOn.remove(project.tasks['appBeforeIntegrationTest'])
     project.integrationTest.finalizedBy.values.remove(project.tasks['appAfterIntegrationTest'])
saladinkzn commented 8 years ago

Well, I've tested gist and it's working as expected (server is not started when integrationTest task is called using ./gradlew integrationTest

Could you provide a minimal example when appBeforeIntegrationTest is called even when integrationTestTask is set to null?