Git Product home page Git Product logo

jenkins's Introduction

Charm Kubernetes Jenkins

This project contains the scripts used to build and test the CDK.

What is where

  • jobs - All jenkins jobs housed here
  • jobs/integration - All integration tests housed here
  • jobs/overlays - All juju bundle overlays housed here.

How to run tests locally

Running the tests locally can be accomplished easily with tox. The tests expect certain environment variables to be set. These can be found by looking at the help output from pytest under the custom options section.

Note: Recommended minimum Python version is 3.6.

> pytest jobs/integration/validation.py --help

custom options:
  --no-flaky-report     Suppress the report at the end of the run detailing
                        flaky test results.
  --no-success-flaky-report
                        Suppress reporting flaky test successesin the report
                        at the end of the run detailing flaky test results.
  --controller=CONTROLLER
                        Juju controller to use
  --model=MODEL         Juju model to use
  --series=SERIES       Base series
  --cloud=CLOUD         Juju cloud to use
  --charm-channel=CHARM_CHANNEL
                        Charm channel to use
  --bundle-channel=BUNDLE_CHANNEL
                        Bundle channel to use
  --snap-channel=SNAP_CHANNEL
                        Snap channel to use eg 1.16/edge
  --is-upgrade          This test should be run with snap and charm upgrades
  --upgrade-snap-channel=UPGRADE_SNAP_CHANNEL
                        Snap channel to use eg 1.16/edge
  --upgrade-charm-channel=UPGRADE_CHARM_CHANNEL
                        Charm channel to use (stable, candidate, beta, edge)
  --snapd-upgrade       run tests with upgraded snapd
  --snapd-channel=SNAPD_CHANNEL
                        Snap channel to install snapcore from

This tells us what the commandline is to run this test and what parameters we need to pass to it. These are passed to pytest running in tox. By default, the working directory for tox is in /var/lib/jenkins, which probably doesn't exist on development machines, so --workdir is used to specify a new directory to use.

tox --workdir .tox -e py3 -- \
    pytest jobs/integration/validation.py \
      --controller aws-us-east-1 \
      --model cdk \
      --cloud aws 2>&1 | tee ~/log.txt

Developing new tests

Jenkins Job Builder is used to generate jobs for Jenkins programmatically. No jobs are created by hand in the Jenkins UI.

To add a new test into Jenkins, it is necessary to create a Jenkinsfile that is a script to run for the job and then a yaml file to describe the job to Jenkins Job Builder. Example job:

validate Jenkinsfile

validate yaml

Documentation

Build

To build the docs do the following:

> tox --workdir .tox -e py3 -- inv build-docs

To build and deploy documentation (requires AWS credentials):

> tox --workdir .tox -e docs

jenkins's People

Contributors

cynerva avatar ktsakalozos avatar hyperbolic2346 avatar knkski avatar kwmonroe avatar wwwtyro avatar mbruzek avatar variabledeclared avatar joedborg avatar johnsca avatar tvansteenburgh avatar evilnick avatar cdkbot 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.