On Sat, May 18, 2019 at 2:00 AM Mani Sarkar <[email protected]> wrote:
> Hi. > > I'm looking for pointers to go about testing a Jenkins plugin. > > That's great that you want to automate testing of your Jenkins plugin! First reference should probably be the Jenkins Developers Handbook page called "Testing Jenkins <https://jenkins.io/doc/developer/testing/>". More general plugin development topics are covered in the Developer Handbook <https://jenkins.io/doc/developer/>. Those more general topics include testing topics and test automation topics. More information is available in various articles linked from the testing section of a blog post "Plugin Development Tutorials, Videos, and More <https://jenkins.io/blog/2017/08/07/intro-to-plugin-development/>". After those overviews, the details in the various testing classes are quite useful as well, including: - JenkinsRule <https://javadoc.jenkins.io/component/jenkins-test-harness/org/jvnet/hudson/test/JenkinsRule.html> - automate a test within a lightweight Jenkins server - LoggerRule <https://javadoc.jenkins.io/component/jenkins-test-harness/org/jvnet/hudson/test/LoggerRule.html> - capture Jenkins logs for assertions - RestartableJenkinsRule <https://javadoc.jenkins.io/component/jenkins-test-harness/org/jvnet/hudson/test/RestartableJenkinsRule.html> - automate a test of Jenkins server restart If you need a git repository as part of your automated tests, there are test extensions that are used in many locations to simplify automated testing of plugins that need to interact with a git repository. > Happy to use mocks but would love to also write a real integration test > against a Jenkins server, where the Jenkins server is using the plugin in > question and is triggered by the test runner itself. > > Has anyone done this before or can point me to some examples that I can > examine. > > Thanks. > > Regards > Mani > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-dev/01342628-e77f-423e-ba49-137a5939e1d3%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-dev/01342628-e77f-423e-ba49-137a5939e1d3%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Thanks! Mark Waite -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAO49JtED43carg7dm9TxAe9Pb%3DJX7W0LGtEaE%2BEWbPurHcH4vA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
