Testing system Groovy scripts locally?

41 views
Skip to first unread message

Dylan Cali

unread,
Jan 3, 2015, 5:35:45 PM1/3/15
to jenkin...@googlegroups.com
Hello,

I have some system groovy scripts which I save in source control and would like to test locally.  I'm having some trouble getting all the dependencies to resolve though.  I'm using Gradle and tried simply "shotgunning" every conceivable dependency, from jenkins-core to each plugin I'm using (appending '@jar' to the maven descriptors), but I haven't been able to get it to work.

Before I continue banging my head against the wall, I wanted to first check if there's a right/clean way to compile and test system scripts locally.

Thanks

Dylan Cali

unread,
Jan 3, 2015, 5:39:55 PM1/3/15
to jenkin...@googlegroups.com
Ha, just as I post that I was able to get it to work by adding one
more dependency, javax.servlet-api. But the question still stands if
there's a more elegant way then the brute force approach I've gone
with.

Thanks

Robert Sandell

unread,
Jan 5, 2015, 6:47:27 AM1/5/15
to jenkin...@googlegroups.com
That's similar to what I've done in the past,
Another approach would be to create an empty plugin project and add your scripts and plugin dependencies to that. Then you can use the jenkins unit test harness for writing your tests and hpi:run for manual testing.

/B


Thanks

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAM1XmN8UT9ht-fsu8hLJp9XUexVg2kidZYxGxCnXxB4K3W5MHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.
Reply all
Reply to author
Forward
0 new messages