blob: 4b515ecbb7671690f9238d1eed59c3cc87378f5d [file] [log] [blame]
---
# ONOS System Test Pipeline jobs
- test-free-job-boiler-plate: &test-free-job-boiler-plate
name: test-free-job-boiler-plate
project-type: freestyle
- job-free-version-plate: &job-free-version-plate
name: job-free-version-plate
version:
- '1.12'
- '1.13'
- '1.14'
- '1.15'
- 'master'
- 'manually'
- test-free-init-procedure-plate: &test-free-init-procedure-plate
name: test-free-init-procedure-plate
project: OnosSystemTest
stream: 'master'
- inject-env-variable-plate: &inject-env-variable-plate
name: inject-env-variable-plate
wrappers:
- inject:
properties-file: '/var/jenkins/TestONOS.property'
script-content: |
echo "ONOSBranch=$ONOSBranch" > /var/jenkins/TestONOS.property
echo "TestONBranch=$TestONBranch" >> /var/jenkins/TestONOS.property
echo "ONOSTag=$ONOSTag" >> /var/jenkins/TestONOS.property
echo "WikiPrefix=$WikiPrefix" >> /var/jenkins/TestONOS.property
override-build-parameters: true
# post_Job
- job-template:
name: postjob-{station-type}
description: |
<!-- Managed by Jenkins Job Builder -->
Click on the "Last Successful Artifacts" to view all of the graphs (also accessible when logged out).<br />
<font color="red">Unless debugging, DO NOT MANUALLY BUILD THIS PIPELINE.</font><br />
<br />
Created by Devin Lim - devin@opennetworking.org<br />
Copyright (c) 2017 Open Networking Foundation (ONF)
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 1
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-{station-type}s'
publishers:
- archive:
artifacts: '*.jpg'
- image-gallery:
- gallery-type: archived-images-gallery
title: 'Test result'
includes: '*.jpg'
- job-template:
name: test-station-log-cleanup-{clean-station-type}
id: test-station-log-cleanup
description: |
<!-- Managed by Jenkins Job Builder -->
clean up periodically ~/OnosSystemTest/TestON/logs - delete logs older than {days_remove} days.
<<: *test-free-job-boiler-plate
<<: *inject-env-variable-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- string:
name: 'DAYS_OLD'
default: '{days_remove}'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-{clean-station-type}s'
triggers:
- timed: '01 08 1{date} * *'
builders:
- shell: !include-raw-escape: vm-bm-clean-up.sh
- job-template:
name: test-station-log-cleanup-CHO
description: |
<!-- Managed by Jenkins Job Builder -->
<<: *test-free-job-boiler-plate
wrappers:
- inject:
properties-file: '/var/lib/jenkins/TestONOS.property'
script-content: |
echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
echo "WikiPrefix=$WikiPrefix" >> /var/lib/jenkins/TestONOS.property
override-build-parameters: true
# post_Job
properties:
- build-discarder:
num-to-keep: 15
parameters:
- string:
name: 'DAYS_OLD'
default: '15'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-CHOs'
triggers:
- timed: '@daily'
builders:
- shell: !include-raw-escape: cho-clean-up.sh
- job-template:
name: QA-check-style
description: |
<!-- Managed by Jenkins Job Builder -->
<h3>ONOS QA Code Style:</h3>
At Open Networking Foundation, we have adopted the <a href="https://github.com/mininet/mininet/wiki/Mininet-Python-Style">Mininet Python Style</a> for our drivers and testcases. The one exception is that TestON does not correctly parse multiline comments in testcases when the ending triple double quotes are on the same line as the comment. Therefore, in the testcases, the ending triple double quotes must be on it's own line.<br />
All .py files that are in the most recent patchset will be style checked.<br />
<br />
Jenkins User will give +1 if all files pass the style check, -1 if there is at least one style check failure.<br />
Jenkins will not comment on Gerrit if there are no .py files to test. This is caused by failing the job with exit code 2.<br />
<br />
Click on the link in the Gerrit patchset comment to view the results of the style check.<br />
Alternatively, you can check the console output to view the files checked and style check raw output.<br />
<br />
You may also manually run this job by selecting "Build with Parameters", then providing the 5-digit change number from Gerrit.<br />
<br />
<h3>Important Notes:</h3>
A build that is "Unstable" has failed the style check. A build with state "Error" means that there were no .py files to check.<br />
Build numbers that are 1 build apart may NOT necessarily correspond to the same patchset!<br />
Manually running this job will NOT leave a comment after the most recent patchset in Gerrit.<br />
<br />
<h3>Style Check PEP8 Exclusions:</h3>
This job mainly follows PEP8 style check, but excludes many errors and warnings.<br />
The following errors and warnings are excluded from the PEP8 check portion of the job:
<ul>
<li>E251</li>
<li>E201</li>
<li>E302</li>
<li>E202</li>
<li>E126</li>
<li>E127</li>
<li>E203</li>
<li>E226</li>
<li>E501</li>
<li>W391</li>
</ul>
<h3>Credits:</h3>
This job is modeled from <a href="https://jenkins.onosproject.org/view/all/job/onos-master-release-build-verify/">onos-master-release-build-verify</a><br />
The check style portion of the job is modeled from "HA-Jobs/codecheck_test"<br />
Created by Jeremy Ronquillo: jeremyr@opennetworking.org or j_ronquillo@u.pacific.edu<br />
<br />
Copyright (c) 2017 Open Networking Foundation (ONF)
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 100
parameters:
- string:
name: 'GERRIT_CHANGE_NUMBER'
default: ''
description: '5-digit number that corresponds to the patch set change on Gerrit.'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
concurrent: true
node: 'TestStation-Jeremys'
triggers:
- gerrit:
server-name: 'OnosSystemTest Project Gerrit'
trigger-on:
- patchset-created-event:
exclude-drafts: false
exclude-trivial-rebase: false
exclude-no-code-change: false
- draft-published-event
- comment-added-contains-event:
comment-contains-value: '(?i)^.*recheck$'
projects:
- project-compare-type: PLAIN
project-pattern: '{project}'
branches:
- branch-compare-type: REG_EXP
branch-pattern: '(master|onos-1.(1[3-9]|[2-9][0-9]))'
wrappers:
- lf-infra-wrappers:
build-timeout: 1800
jenkins-ssh-credential: '{jenkins-ssh-credential}'
builders:
- shell: !include-raw-escape: check-style.sh
publishers:
- warnings:
workspace-file-scanners:
- file-pattern: pep8Result.txt
scanner: Pep8
total-thresholds:
unstable:
total-all: 1
- job-template:
name: delta-nightly
description: |
<!-- Managed by Jenkins Job Builder -->
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- string:
name: 'NIGHTLY_FILE_NAME'
default: ''
description: |
Name of ONOS nightly build file <br />
will be set to the latest file if not specified here
- string:
name: 'ONOS_VERSION'
default: '1.11.0'
description: 'Version number in ONOS nightly build file'
- string:
name: 'DELTA_PATH'
default: '/home/sdn'
description: 'Path of DELTA project'
- string:
name: 'WIKI_PREFIX'
default: 'master'
- bool:
name: 'CLEANUP'
default: true
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-BMs'
wrappers:
- inject:
properties-file: '/var/jenkins/TestONOS.property'
builders:
- shell: !include-raw-escape: delta-script.sh
publishers:
- plot:
- title: 'DELTA Test Results for master'
group: 'DELTA-nightly'
yaxis: 'Number of test cases'
style: line
series:
- file: 'DELTA-nightly.csv'
format: 'csv'
# Todo : add confluence ( use pipeline for post build ..? )
- job-template:
name: init-CHO
description: |
<!-- Managed by Jenkins Job Builder -->
1) Set a specific onos branch to test; <br />
2) pull and checkout the branch; <br />
3) build onos and package to tar.gz <br />
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- string:
name: 'ONOSBranch'
default: 'master'
description: |
set onos branch to test. default to "master", <br />
but can also be set at "onos-1.2", etc. <br />
This parameter is also use to trigger where the test results to be posted
- string:
name: 'ONOSJVMHeap'
default: "\"${{JAVA_OPTS:--Xms8G -Xmx8G}}\""
description: 'onos cell jvm heap size setting'
- string:
name: 'TestONBranch'
default: 'master'
description: 'sets TestON branch'
- string:
name: 'ONOSTag'
default: ''
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric5s'
wrappers:
- inject:
properties-file: '/var/lib/jenkins/TestONOS.property'
script-content: |
echo "ONOSBranch=$ONOSBranch" > /var/lib/jenkins/TestONOS.property
echo "TestONBranch=$TestONBranch" >> /var/lib/jenkins/TestONOS.property
echo "ONOSTag=$ONOSTag" >> /var/lib/jenkins/TestONOS.property
override-build-parameters: true
builders:
- shell: !include-raw-escape: cho-init.sh
- job-template:
name: running-CHO
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 30
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric5s'
triggers:
- reverse:
jobs: 'init-CHO'
result: 'failure'
builders:
- shell: !include-raw-escape: running-cho.sh
- job-template:
name: 'SR-log-{version}'
id: SR-log-storage
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
num-to-keep: 50
parameters:
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Fabric{fabricOn}s'
publishers:
- archive:
artifacts: '*'
- job-template:
name: test-HA
<<: *test-free-job-boiler-plate
properties:
- build-discarder:
days-to-keep: 5
num-to-keep: 100
parameters:
- string:
name: 'TEST_NAME'
default: 'HAbackupRecover'
description: 'The name of the TestON test suite'
- lf-infra-parameters:
project: '{project}'
branch: '{stream}'
stream: '{stream}'
lftools-version: '{lftools-version}'
node: 'TestStation-Jons'
triggers:
- reverse:
jobs: 'test-HA'
result: 'failure'
builders:
- shell: !include-raw-escape: test-ha.sh
publishers:
- plot:
- title: 'Test job results'
group: 'Test-HA'
yaxis: 'Number of test cases'
style: line
series:
- file: 'results.csv'
format: 'csv'
- title: 'Timers'
group: 'Test-HA'
yaxis: 'Time in seconds'
style: line
series:
- file: 'Timers.csv'
format: 'csv'
- post-tasks:
- escalate-status: true
script: |
if [ -e ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt ] && ! grep -q "FAIL" ${{WORKSPACE}}/${{TEST_NAME##*/}}Wiki.txt
then
exit 0
else
exit 1
fi
- project:
name: post-result-jobs
project-name: post-result-jobs
<<: *test-free-init-procedure-plate
jobs:
- 'postjob-{station-type}':
station-type:
- 'VM'
- 'BM'
- 'Fabric'
- 'Fabric2'
- 'Fabric3'
- 'Fabric4'
- 'Fabric5'
- project:
name: cleanup-jobs
project-name: cleanup-jobs
<<: *test-free-init-procedure-plate
jobs:
- 'test-station-log-cleanup':
clean-station-type:
- 'BM'
- 'Fabric'
- 'Fabric2'
- 'Fabric3'
- 'Fabric4'
days_remove: '30'
date: ''
- 'test-station-log-cleanup':
clean-station-type:
- 'VM'
- 'Fabric5'
days_remove: '15'
date: ',15'
- 'test-station-log-cleanup-CHO'
- project:
name: check-style
project-name: check-style
<<: *test-free-init-procedure-plate
jobs:
- 'QA-check-style'
- project:
name: delta-test
project-name: delta-test
<<: *test-free-init-procedure-plate
jobs:
- 'delta-nightly'
- project:
name: cho-tests
project-name: cho-tests
<<: *test-free-init-procedure-plate
jobs:
- 'init-CHO'
- 'running-CHO'
- project:
name: log-pipeline
project-name: 'log-pipeline'
<<: *test-free-init-procedure-plate
sr-version-before-previous: '1.14'
sr-version-previous: '1.15'
sr-version-current: 'master'
jobs:
- 'SR-log-storage':
version: '{sr-version-current}'
fabricOn: '4'
- 'SR-log-storage':
version: '{sr-version-previous}'
fabricOn: '2'
- 'SR-log-storage':
version: '{sr-version-before-previous}'
fabricOn: '3'
- project:
name: personal-station
project-name: 'personal-station'
<<: *test-free-init-procedure-plate
jobs:
- 'test-HA'