fbad9e8b2dcbb45187eb4f321f89d181dae7394b
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-verify-testfw.yaml
1 ---
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20
21 #--------------------------------------------------------------------------------------
22 # The jobs declared in this JJB configuration file are used for verifying patches
23 # that are sent to the repositories below
24 #   - cloud-infra/test
25 #
26 # These jobs verify changes that
27 #   - implement new features or fix bugs to the playbooks and roles used for utilizing
28 #     open source test frameworks such as opnfv/functest and opnfv/yardstick
29 #   - bump versions of the open source test frameworks
30 #
31 # These jobs are set to run on slaves with label vpod-test-ubuntu1604.
32 # The slaves have
33 #   - Ubuntu1604 as the base distro
34 #   - nested virtualization
35 #   - internet access
36 #   - passwordless sudo
37 #   - 16 CPUs/32GB RAM/200 GB Disk
38 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
39 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
40 #
41 # The slaves should have a promoted version of a cloud infra scenario deployed on them.
42 # Currently k8-calico-nofeature scenario is deployed on the slaves.
43 #--------------------------------------------------------------------------------------
44
45 - project:
46     name: 'cloud-infra-verify-test'
47
48     project: 'infra/test'
49
50     stream:
51       - 'master':
52           branch: '{stream}'
53           disabled: 'false'
54
55     os:
56       - ubuntu1804:
57           disabled: 'false'
58           distribution: 'ubuntu18'
59       - centos7:
60           disabled: 'true'
61           distribution: 'centos7'
62
63     type:
64       - virtual
65
66     phase:
67       - functest
68       - yardstick
69
70     jobs:
71       - 'cloud-infra-verify-testfw-{os}-{type}-{stream}'
72       - 'cloud-infra-verify-testfw-{os}-{phase}-{type}-{stream}'
73
74 - job-template:
75     name: 'cloud-infra-verify-testfw-{os}-{type}-{stream}'
76
77     project-type: multijob
78
79     disabled: '{obj:disabled}'
80
81     concurrent: true
82
83     parameters:
84       - project-parameters:
85           project: '{project}'
86           branch: '{branch}'
87       - nordix-gerrit-parameters
88       - label:
89           name: SLAVE_LABEL
90           default: 'vpod-test-{os}'
91           description: 'Slave label to schedule this job on. These slaves have cloud infra installed on them.'
92       - string:
93           name: DISTRIBUTION
94           default: '{distribution}'
95           description: 'Distribution to use for configuring target nodes (networking etc.)'
96       - string:
97           name: DEPLOY_SCENARIO
98           default: 'k8-calico-nofeature'
99           description: 'Scenario to deploy and test'
100       - string:
101           name: TEST_SUITE
102           default: 'healthcheck'
103           description: 'Test suite to run'
104       - string:
105           name: CLEANUP
106           default: 'true'
107           description: 'Cleanup leftovers of the previous run'
108
109     properties:
110       - logrotate
111       - build-blocker:
112           use-build-blocker: true
113           blocking-jobs:
114             - 'cloud-infra-verify-testfw-{os}-.*'
115           block-level: 'NODE'
116       - throttle:
117           max-per-node: 1
118           max-total: 3
119           option: project
120
121     wrappers:
122       - build-timeout:
123           timeout: 120
124       - fix-workspace-permissions
125
126     scm:
127       - git-scm-gerrit:
128           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
129           branch: '{branch}'
130           refspec: $GERRIT_REFSPEC
131
132     triggers:
133       - nordix-gerrit-trigger-patchset-created:
134           project: 'infra\/test'
135           branch: '{branch}'
136           files: '**'
137
138     builders:
139       - multijob:
140           name: functest
141           condition: SUCCESSFUL
142           projects:
143             - name: 'cloud-infra-verify-testfw-{os}-functest-{type}-{stream}'
144               current-parameters: true
145               predefined-parameters: |
146                 DISTRIBUTION=$DISTRIBUTION
147                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
148                 TEST_SUITE=$TEST_SUITE
149                 CLEANUP=$CLEANUP
150                 GERRIT_PROJECT=$GERRIT_PROJECT
151                 GERRIT_BRANCH=$GERRIT_BRANCH
152                 GERRIT_REFSPEC=$GERRIT_REFSPEC
153                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
154                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
155               node-parameters: true
156               kill-phase-on: FAILURE
157               abort-all-job: true
158       - multijob:
159           name: yardstick
160           condition: SUCCESSFUL
161           projects:
162             - name: 'cloud-infra-verify-testfw-{os}-yardstick-{type}-{stream}'
163               current-parameters: true
164               predefined-parameters: |
165                 DISTRIBUTION=$DISTRIBUTION
166                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
167                 TEST_SUITE=$TEST_SUITE
168                 CLEANUP=$CLEANUP
169                 GERRIT_PROJECT=$GERRIT_PROJECT
170                 GERRIT_BRANCH=$GERRIT_BRANCH
171                 GERRIT_REFSPEC=$GERRIT_REFSPEC
172                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
173                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
174               node-parameters: true
175               kill-phase-on: FAILURE
176               abort-all-job: true
177
178 - job-template:
179     name: 'cloud-infra-verify-testfw-{os}-{phase}-{type}-{stream}'
180
181     disabled: false
182
183     concurrent: true
184
185     properties:
186       - logrotate
187
188     parameters:
189       - string:
190           name: PROJECT
191           default: $GERRIT_PROJECT
192       - string:
193           name: DISTRIBUTION
194           default: 'ubuntu18'
195           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
196       - string:
197           name: DEPLOY_SCENARIO
198           default: 'k8-calico-nofeature'
199           description: 'Scenario to deploy and test'
200       - string:
201           name: TEST_FW
202           default: '{phase}'
203           description: 'Test framework to use'
204       - string:
205           name: TEST_SUITE
206           default: 'healthcheck'
207           description: 'Test suite to run'
208       - string:
209           name: TEST_REPO_URL
210           default: 'https://gerrit.nordix.org/infra/test.git'
211           description: 'URL to Nordix Cloud Infra test repository'
212       - string:
213           name: CLEANUP
214           default: 'false'
215
216     wrappers:
217       - build-timeout:
218           timeout: 120
219       - fix-workspace-permissions
220
221     scm:
222       - git-scm-gerrit:
223           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
224           branch: '{branch}'
225           refspec: $GERRIT_REFSPEC
226
227     builders:
228       - 'cloud-infra-testfw-macro'
229
230 # vim: set ts=2 sw=2 expandtab: