Giter Site home page Giter Site logo

examplesharedlibrary's Introduction

exampleSharedLibrary

This project contains an example of jenkins shared library and How to test it.

  • Unit test should be in test folder.
  • Integration test should be in it-test folder and follow this pattern : Test.groovy

Steps

If you run the Jenkinsfile of this project you will see that it run some steps :

  • Checkout the project (classical github checkout but you can change it)
  • Create a specific branch of the project and push it to github (in order to load the shared library based on it later)
  • Build the project with gradle, and execute all of the unit tests
    • report will be in Jenkins Tests reports (Thanks to Junit)
  • If there is no unit test error then
  • Execute all of the integration tests (you can change this steps if you want to run only some it tests)
    • report will be in the Jenkins log (and not in the Jenkins test report) but build status change if some test failed

Prerequisites

To run this example project you need to add this following plugins in Jenkins master instance :

Jenkinsfile customization

Run test in parallel

By default all of the it-test are running in parallel (on node for each test class). This improve performance but sometimes this is not possible because 2 tests cannot run each other at the same times. For that it is possible to declare the list of "sequential test" in the groovy List allTestsMustRunInSequential

Configure specific node

Each it test is running in separate Jenkins node. By default we call a node without label. If a specific test need a specific label this can be defined in the groovy Map allTestsNode

examplesharedlibrary's People

Contributors

efluid avatar tcollignon avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.