ghale / gradle-jenkins-plugin

Gradle plugin to programmatically configure Jenkins jobs.
123 stars 42 forks source link

Refactor tests to use a testing framework #29

Closed ghale closed 10 years ago

ghale commented 10 years ago

There's been a lot of evolution since the tests were first written and later tests have just fallen in line with the original style. They're nasty and should be refactored to use a framework like Spock (for all the good reasons that test frameworks exist).

zeeke commented 10 years ago

I agree. Also, it would be useful to have a few tests that use jenkins-test-harness to test a complete feature.

sgoings commented 10 years ago

You also might want to look into https://github.com/nebula-plugins/nebula-test for your Gradle Plugin oriented tests.

ghale commented 10 years ago

@zeeke - agreed, some integration tests would be well worthwhile

@sgoings - thanks for the pointer to nebula-test, looks sweet

judoole commented 10 years ago

How about https://github.com/cucumber/cucumber-jvm ? Great support for Groovy and Java. Excellent for BDD and now excellent support in IntelliJ.

zeeke commented 10 years ago

@ghale I tried to use jenkins-test-harness without success. It seems to works well only when developing a jenkins plugin and building with maven.

So, we can think about refactor what already is in place like mocking JenkinsRESTServiceImpl as it is not a bad solutaion at all.

ghale commented 10 years ago

@zeeke Thanks for looking into the jenkins-test-harness thing. Too bad it doesn't fit.

I've converted a couple of test classes over to Spock/Nebula since I was mucking around with them and had the opportunity. I'm going to look at converting the rest over the next few days as I have time.

ghale commented 10 years ago

All tests have been refactored to use Spock/Nebula-test.