commit | 5c9a67c9c81eb1196b021334b1b76b80220632e4 | [log] [tgz] |
---|---|---|
author | Zack Williams <zdw@opennetworking.org> | Fri Apr 13 19:51:11 2018 +0000 |
committer | Gerrit Code Review <gerrit@opencord.org> | Fri Apr 13 19:51:11 2018 +0000 |
tree | 9a76a95e0d7cf74e2497b16e1bf8c3f439d7e6b6 | |
parent | 93baebff28f76822fbb377f38571333c44692644 [diff] | |
parent | 0822a13f2ecbe6cc8ea50dea40307a44d33645be [diff] |
Merge "Add sonarqube coverage and verification tests"
This repo holds configuration for the Jenkins testing infrastructure used by CORD.
The best way to work with this repo is to check it out with repo
, per these instructions: Downloading testing and QA repositories
NOTE: This repo uses git submodules. If you have trouble with the tests or other tasks, please run:
git submodule init && git submodule update
to obtain these submodules, asrepo
won't do this automatically for you.
When adding a new git repo that needs tests:
Create a new file in jjb/verify
named <reponame>.yaml
Create a project using the name of the repo, and a job-group section with a list of jobs-template id
s to invoke.
Optional: If you have more than one job that applies to the repo, add a dependency-jobs
variable to each item the job-group
jobs
list to control the order of jobs to invoke. Note that this is a string with the name of the jobs as created in Jenkins, not the job-template
id.
To create jobs that are usable by multiple repos, you want to create a job-template that can be used by multiple jobs.
Most job-template
s are kept in jjb/*.yaml
. See lint.yaml
or api-test.yaml
for examples.
Every job-template
must have at least a name
(which creates the name of the job in Jenkins) and an id
item (referred to in the job-group
), as well as several modules that invoke Jenkins functionality, or macros
(see below, and in the docs) that customize or provide defaults for those modules.
Default values can be found in jjb/defaults.yaml
. These can be used in projects
, jobs
, job-templates
.
NOTE: Defaults don't work with
macros
- all parameters must be passed to every macro invocation.
If you need to customize how a Jenkins module is run, consider creating a reusable macro. These are generally put in jjb/cord-macros.yaml
, and have names matching cord-infra-*
.
See also global-jjb/jjb/lf-macros.yaml
for more macros to use (these have name matching lf-infra-*
).
There are a few useful macros defined in jjb/cord-macros.yml
cord-infra-properties
- sets build discarder settingscord-infra-gerrit-repo-scm
- checks out the entire source tree with the repo
toolcord-infra-gerrit-repo-patch
- checks out a patch to a git repo within a checked out repo source tree (WIP, doesn't work yet)cord-infra-gerrit-trigger-patchset
- triggers build on gerrit new patchset, draft publishing, comments, etc.cord-infra-gerrit-trigger-merge
- triggers build on gerrit mergeJJB job definitions can be tested by running:
make test
Which will create a python virtualenv, install jenkins-job-builder in it, then try building all the job files, which are put in job-configs
and can be inspected.
The output of this is somewhat difficult to decipher, sometimes requiring you to go through the python backtrace to figure out where the error occurred in the jenkins-job-builder source code.
If you make changes which create a new packer image, you have to manually set the instance AMI ID
on jenkins in Global Config > Cloud > Amazon EC2.
If you create a new cloud instance type, make sure to set both the Security group names
and Subnet ID for VPC
or it will fail to instantiate.