Jenkins Global Library Example with Unit tests

Language: Groovy

Keywords: ci-cd, jenkins-ci, jenkins-global-library, jenkins-pipeline, jenkinsfile

Jenkins Shared Library Example

This repository contains examples of a Jenkins Shared/Global Library with Unit tests.

Build Status


  • Gradle for dependency management and test configuration (using shared-libraries-gradle-plugin)
  • IDE support for IntelliJ (Project detection + Auto-Completion)
  • Unit tests with JenkinsPipelineUnit


Using Jenkins and writing pipeline-as-code is very powerful but can get pretty complex. To speed up the development cycle this example uses JenkinsPipelineUnit, which lets you write unit tests on the configuration and conditional logic of the pipeline code, by providing a mock execution of the pipeline. You can mock built-in Jenkins commands, job configurations, see the stacktrace of the whole execution and even track regressions.

Run the tests with the following command:

gradle test

Read more

Project Statistics

Sourcerank 1
Repository Size 62.5 KB
Stars 1
Forks 0
Watchers 1
Open issues 0
Dependencies 1
Contributors 1
Tags 1
Last updated
Last pushed

Top Contributors See all


Recent Tags See all

v0.1 October 28, 2017

Something wrong with this page? Make a suggestion

Last synced: 2018-08-17 21:38:09 UTC

Login to resync this repository