blob: 01ceb6a65b63649864eec20f158e1f812c2e003e [file] [log] [blame]
Devin Lime1346f42018-05-15 15:41:36 -07001#!groovy
Jeremy Ronquillo6fbfdd52019-07-09 13:49:34 -07002// Copyright 2019 Open Networking Foundation (ONF)
Devin Limf5175192018-05-14 19:13:22 -07003//
4// Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
5// the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
6// or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
7//
8// TestON is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation, either version 2 of the License, or
11// (at your option) any later version.
12//
13// TestON is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with TestON. If not, see <http://www.gnu.org/licenses/>.
20
Jeremy Ronquillo6fbfdd52019-07-09 13:49:34 -070021// This is the Jenkins script for master-trigger
Devin Limf5175192018-05-14 19:13:22 -070022
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070023import groovy.time.TimeCategory
24import groovy.time.TimeDuration
25
Devin Limf5175192018-05-14 19:13:22 -070026// set the functions of the dependencies.
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070027graphs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsGraphs.groovy' )
Devin Limb734ea52018-05-14 14:13:05 -070028fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
Jeremy Ronquillo64eeeb12019-05-13 11:19:46 -070029test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
Devin Lim2edfcec2018-05-09 17:16:21 -070030
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -070031INITIALIZATION_TIMEOUT_MINUTES = 10 // timeout init() function if it takes too long.
32
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070033onos_tag = null
34manually_run = null
35now = null
36today = null
37onos_branches = null
38day = null
39post_result = null
40branchesParam = null
41isFabric = null
42testsParam = null
Jeremy Ronquillo3c2f10d2019-06-10 16:54:46 -070043simulateDay = null
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -070044pipelineTimeOut = null
Jeremy Ronquillo4fd82442019-05-21 20:56:58 -070045
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070046dayMap = [:]
47fullDayMap = [:]
Jeremy Ronquilloa37920b2019-05-23 14:34:25 -070048all_testcases = [:]
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070049runTest = [:]
50selectedTests = [:]
51graphPaths = [:]
Devin Lim2edfcec2018-05-09 17:16:21 -070052
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070053main()
Devin Limf5175192018-05-14 19:13:22 -070054
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070055def main() {
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -070056 timeout( time: INITIALIZATION_TIMEOUT_MINUTES, unit: "MINUTES" ){
57 init()
58 }
Jeremy Ronquillo194e2a72019-08-09 12:36:09 -070059 if ( selectedTests == [:] && manually_run ){
60 echo "No valid tests provided. Check if the provided test(s) is/are in test.json, and try again.\n\nProvided Tests:\n" + testsParam
61 throw new Exception( "No valid tests provided. Check if the provided test(s) is/are in test.json, and try again." )
62 }
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -070063 timeout( time: pipelineTimeOut, unit: "MINUTES" ){
64 runTests()
65 generateGraphs()
66 }
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070067}
68
69// **************
70// Initialization
71// **************
72
73// initialize file scope vars
74def init(){
75 // get the name of the job.
76 jobName = env.JOB_NAME
77
78 // set the versions of the onos
79 fileRelated.init()
80 test_list.init()
81 readParams()
82
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070083 // list of the tests to be run will be saved in each choices.
84 day = ""
85
86 initDates()
87 onos_branches = getONOSBranches()
88 selectedTests = getONOSTests()
Jeremy Ronquilloa5aa7c12019-06-04 10:26:36 -070089
Jeremy Ronquillod98c2a12019-06-07 15:13:29 -070090 initGraphPaths()
91
Jeremy Ronquilloa5aa7c12019-06-04 10:26:36 -070092 echo "selectedTests: " + selectedTests
Jeremy Ronquillo3c2f10d2019-06-10 16:54:46 -070093 echo "onos_branches: " + onos_branches
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -070094}
95
96def readParams(){
97 // get post result from the params for manually run.
98 post_result = params.PostResult
99 manually_run = params.manual_run
100 onos_tag = params.ONOSTag
101 branchesParam = params.branches
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700102 isOldFlow = true // hardcoding to true since we are always using oldFlow.
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700103 testsParam = params.Tests
104 isFabric = params.isFabric
Jeremy Ronquillo3c2f10d2019-06-10 16:54:46 -0700105 simulateDay = params.simulate_day
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -0700106 pipelineTimeOut = params.TimeOut.toInteger()
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700107}
Devin Lim2edfcec2018-05-09 17:16:21 -0700108
109// Set tests based on day of week
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700110def initDates(){
111 echo "-> initDates()"
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700112 now = getCurrentTime()
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700113 dayMap = [ ( Calendar.MONDAY ) : "mon",
114 ( Calendar.TUESDAY ) : "tue",
115 ( Calendar.WEDNESDAY ) : "wed",
116 ( Calendar.THURSDAY ) : "thu",
117 ( Calendar.FRIDAY ) : "fri",
118 ( Calendar.SATURDAY ) : "sat",
119 ( Calendar.SUNDAY ) : "sun" ]
120 fullDayMap = [ ( Calendar.MONDAY ) : "Monday",
121 ( Calendar.TUESDAY ) : "Tuesday",
122 ( Calendar.WEDNESDAY ) : "Wednesday",
123 ( Calendar.THURSDAY ) : "Thursday",
124 ( Calendar.FRIDAY ) : "Friday",
125 ( Calendar.SATURDAY ) : "Saturday",
126 ( Calendar.SUNDAY ) : "Sunday" ]
Jeremy Ronquillo3c2f10d2019-06-10 16:54:46 -0700127 if ( simulateDay == "" ){
128 today = now[ Calendar.DAY_OF_WEEK ]
129 day = dayMap[ today ]
130 print now.toString()
131 } else {
132 day = simulateDay
133 }
Jon Hall6af749d2018-05-29 12:59:47 -0700134}
Jeremy Ronquilloa37920b2019-05-23 14:34:25 -0700135
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700136def getCurrentTime(){
137 // get time of the PST zone.
138
139 TimeZone.setDefault( TimeZone.getTimeZone( 'PST' ) )
140 return new Date()
141}
142
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700143// gets ONOS branches from params or string parameter
144def getONOSBranches(){
145 echo "-> getONOSBranches()"
146 if ( manually_run ){
147 return branchesParam.tokenize( "\n;, " )
Jeremy Ronquillo64eeeb12019-05-13 11:19:46 -0700148 } else {
Jeremy Ronquillo3c2f10d2019-06-10 16:54:46 -0700149 return test_list.getBranchesFromDay( day )
Devin Lim2edfcec2018-05-09 17:16:21 -0700150 }
151}
Devin Limf5175192018-05-14 19:13:22 -0700152
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700153def getONOSTests(){
154 echo "-> getONOSTests()"
155 if ( manually_run ){
156 return test_list.getTestsFromStringList( testsParam.tokenize( "\n;, " ) )
157 } else {
Jeremy Ronquillo3c2f10d2019-06-10 16:54:46 -0700158
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700159 return test_list.getTestsFromDay( day )
Jeremy Ronquilloa37920b2019-05-23 14:34:25 -0700160 }
Devin Lim2edfcec2018-05-09 17:16:21 -0700161}
Devin Limf5175192018-05-14 19:13:22 -0700162
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700163// init paths for the files and directories.
164def initGraphPaths(){
Jeremy Ronquillo1e5d7f22019-07-17 14:18:42 -0700165 graphPaths.put( "histogramMultiple", fileRelated.rScriptPaths[ "scripts" ][ "histogramMultiple" ] )
166 graphPaths.put( "pieMultiple", fileRelated.rScriptPaths[ "scripts" ][ "pieMultiple" ] )
167 graphPaths.put( "saveDirectory", fileRelated.workspaces[ "VM" ] )
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700168}
Jeremy Ronquillo64eeeb12019-05-13 11:19:46 -0700169
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700170// **********************
171// Determine Tests to Run
172// **********************
173
174def printTestsToRun( runList ){
175 if ( manually_run ){
176 println "Tests to be run manually:"
177 } else {
178 if ( isFabric ){
179 postToSlackSR()
Devin Lim2edfcec2018-05-09 17:16:21 -0700180 }
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700181 if ( today == Calendar.MONDAY ){
182 postToSlackTestsToRun()
183 }
184 println "Defaulting to " + day + " tests:"
Devin Lim2edfcec2018-05-09 17:16:21 -0700185 }
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700186 for ( list in runList ){
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700187 echo "" + list
188 }
Devin Lim2edfcec2018-05-09 17:16:21 -0700189}
Devin Limf5175192018-05-14 19:13:22 -0700190
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700191def postToSlackSR(){
192 // If it is automated running, it will post the beginning message to the channel.
193 slackSend( channel: 'sr-failures', color: '#03CD9F',
194 message: ":sparkles:" * 16 + "\n" +
195 "Starting tests on : " + now.toString() +
196 "\n" + ":sparkles:" * 16 )
197}
198
199def postToSlackTestsToRun(){
200 slackSend( color: '#FFD988',
201 message: "Tests to be run this weekdays : \n" +
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700202 printDaysForTest() )
203}
204
205def printDaysForTest(){
206 // Print the days for what test has.
207 AllTheTests = test_list.getAllTests()
208
209 result = ""
210 for ( String test in AllTheTests.keySet() ){
211 result += test + ": ["
212 test_schedule = AllTheTests[ test ][ "schedules" ]
213 for ( String sch_dict in test_schedule ){
214 for ( String day in test_list.convertScheduleKeyToDays( sch_dict[ "branch" ] ) ){
215 result += day + " "
216 }
217 }
218 result += "]\n"
219 }
220 return result
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700221}
222
223// *********
224// Run Tests
225// *********
226
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700227def tagCheck( onos_tag, onos_branch ){
228 // check the tag for onos if it is not empty
229
230 result = "git checkout "
231 if ( onos_tag == "" ){
232 //create new local branch
233 result += onos_branch
234 }
235 else {
236 //checkout the tag
237 result += onos_tag
238 }
239 return result
240}
241
Jeremy Ronquilloc3188b62019-08-19 15:51:17 -0700242def preSetup( onos_branch, test_branch, onos_tag, isManual, category ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700243 // pre setup part which will clean up and checkout to corresponding branch.
244
245 result = ""
246 if ( !isManual ){
Jeremy Ronquilloc3188b62019-08-19 15:51:17 -0700247 if ( category == "MO" ){
248 result = '''echo -e "\n##### Set onos-config branch"
249 cd ~/onos-test/
250 git checkout HEAD~1 # Make sure you aren't on a branch
251 git branch | grep -v "detached from" | xargs git branch -d # delete all local branches merged with remote
252 git branch -D ''' + test_branch + ''' # just in case there are local changes. This will normally result in a branch not found error
253 git reset --hard origin/''' + test_branch + ''' # force local index to match remote branch
254 git clean -df # clean any local files
255 git fetch --all # update all caches from remotes
256 git reset --hard origin/''' + onos_branch + ''' # force local index to match remote branch
257 git clean -df
258 git branch
259 git log -1 --decorate
260 '''
261 } else {
262 result = '''echo -e "\n##### Set TestON Branch #####"
263 echo "TestON Branch is set on: ''' + test_branch + '''"
264 cd ~/OnosSystemTest/
265 git checkout HEAD~1 # Make sure you aren't pn a branch
266 git branch | grep -v "detached from" | xargs git branch -d # delete all local branches merged with remote
267 git branch -D ''' + test_branch + ''' # just in case there are local changes. This will normally result in a branch not found error
268 git clean -df # clean any local files
269 git fetch --all # update all caches from remotes
270 git reset --hard origin/''' + test_branch + ''' # force local index to match remote branch
271 git clean -df # clean any local files
272 git checkout ''' + test_branch + ''' #create new local branch
273 git branch
274 git log -1 --decorate
275 echo -e "\n##### Set ONOS Branch #####"
276 echo "ONOS Branch is set on: ''' + onos_branch + '''"
277 echo -e "\n #### check karaf version ######"
278 env |grep karaf
279 cd ~/onos
280 git checkout HEAD~1 # Make sure you aren't pn a branch
281 git branch | grep -v "detached from" | xargs git branch -d # delete all local branches merged with remote
282 git branch -D ''' + onos_branch + ''' # just incase there are local changes. This will normally result in a branch not found error
283 git clean -df # clean any local files
284 git fetch --all # update all caches from remotes
285 git reset --hard origin/''' + onos_branch + ''' # force local index to match remote branch
286 git clean -df # clean any local files
287 rm -rf buck-out
288 rm -rf bazel-*
289 ''' + tagCheck( onos_tag, onos_branch ) + '''
290 git branch
291 git log -1 --decorate
292 echo -e "\n##### set jvm heap size to 8G #####"
293 echo ${ONOSJAVAOPTS}
294 inserted_line="export JAVA_OPTS=\"\${ONOSJAVAOPTS}\""
295 sed -i "s/bash/bash\\n$inserted_line/" ~/onos/tools/package/bin/onos-service
296 echo "##### Check onos-service setting..... #####"
297 cat ~/onos/tools/package/bin/onos-service
298 export JAVA_HOME=/usr/lib/jvm/java-8-oracle'''
299 }
300
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700301 } else {
Jeremy Ronquilloc3188b62019-08-19 15:51:17 -0700302 if ( category == "MO" ) {
303 result = '''echo "Since this is a manual run, we'll use the current onos-test branch:"
304 echo "onos-test branch:"
305 cd ~/onos-test
306 git branch
307 '''
308 } else {
309 result = '''echo "Since this is a manual run, we'll use the current ONOS and TestON branch:"
310 echo "ONOS branch:"
311 cd ~/OnosSystemTest/
312 git branch
313 echo "TestON branch:"
314 cd ~/TestON/
315 git branch'''
316 }
317
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700318 }
319 return result
320}
321
322def postSetup( onos_branch, test_branch, onos_tag, isManual ){
323 // setup that will build ONOS
324
325 result = ""
326 if ( !isManual ){
327 result = '''echo -e "Installing bazel"
328 cd ~
329 rm -rf ci-management
330 git clone https://gerrit.onosproject.org/ci-management
331 cd ci-management/jjb/onos/
332 export GERRIT_BRANCH="''' + onos_branch + '''"
333 chmod +x install-bazel.sh
334 ./install-bazel.sh
335 '''
336 } else {
337 result = '''echo -e "Since this is a manual run, we will not install Bazel."'''
338 }
339 return result
340}
341
342def generateKey(){
343 // generate cluster-key of the onos
344
345 try {
346 sh script: '''
347 #!/bin/bash -l
348 set +e
349 . ~/.bashrc
350 env
351 onos-push-bits-through-proxy
352 onos-gen-cluster-key -f
353 ''', label: "Generate Cluster Key", returnStdout: false
354 } catch ( all ){
355 }
356}
357
358// Initialize the environment Setup for the onos and OnosSystemTest
Jeremy Ronquillocab1bf72019-08-21 14:26:45 -0700359def envSetup( onos_branch, test_branch, onos_tag, category, manuallyRun, nodeLabel ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700360 // to setup the environment using the bash script
Jeremy Ronquillocab1bf72019-08-21 14:26:45 -0700361 stage( "Environment Setup: " + onos_branch + "-" + nodeLabel + "-" + category ) {
362 // after env: ''' + borrow_mn( category ) + '''
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700363 sh script: '''#!/bin/bash -l
364 set +e
365 . ~/.bashrc
366 env
Jeremy Ronquillocab1bf72019-08-21 14:26:45 -0700367 ''' + preSetup( onos_branch, test_branch, onos_tag, manuallyRun, category ), label: "Repo Setup", returnStdout: false
Jeremy Ronquilloc3188b62019-08-19 15:51:17 -0700368 if ( category != "MO" ){
369 sh script: postSetup( onos_branch, test_branch, onos_tag, manuallyRun ), label: "Install Bazel", returnStdout: false
370 generateKey()
371 }
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700372 }
373}
374
375// export Environment properties.
376def exportEnvProperty( onos_branch, test_branch, jobOn, wiki, tests, postResult, manually_run, onosTag, isOldFlow, nodeLabel ){
377 // export environment properties to the machine.
378
379 filePath = "/var/jenkins/TestONOS-" + jobOn + "-" + onos_branch + ".property"
380
381 stage( "Property Export: " + onos_branch + "-" + nodeLabel + "-" + jobOn ) {
382 sh script: '''
383 echo "ONOSBranch=''' + onos_branch + '''" > ''' + filePath + '''
384 echo "TestONBranch=''' + test_branch + '''" >> ''' + filePath + '''
385 echo "ONOSTag=''' + onosTag + '''" >> ''' + filePath + '''
386 echo "WikiPrefix=''' + wiki + '''" >> ''' + filePath + '''
387 echo "ONOSJAVAOPTS=''' + env.ONOSJAVAOPTS + '''" >> ''' + filePath + '''
388 echo "Tests=''' + tests + '''" >> ''' + filePath + '''
389 echo "postResult=''' + postResult + '''" >> ''' + filePath + '''
390 echo "manualRun=''' + manually_run + '''" >> ''' + filePath + '''
391 echo "isOldFlow=''' + isOldFlow + '''" >> ''' + filePath + '''
392 ''', label: "Exporting Property File: " + filePath
393 }
394}
395
396def trigger( branch, tests, nodeLabel, jobOn, manuallyRun, onosTag ){
397 // triggering function that will setup the environment and determine which pipeline to trigger
398
399 println "Job name: " + jobOn + "-pipeline-" + ( manuallyRun ? "manually" : branch )
400 def wiki = branch
401 def onos_branch = test_list.addPrefixToBranch( branch )
402 def test_branch = test_list.addPrefixToBranch( branch )
403 assignedNode = null
404 node( label: nodeLabel ) {
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700405 envSetup( onos_branch, test_branch, onosTag, jobOn, manuallyRun, nodeLabel )
406 exportEnvProperty( onos_branch, test_branch, jobOn, wiki, tests, post_result, manuallyRun, onosTag, isOldFlow, nodeLabel )
407 assignedNode = env.NODE_NAME
408 }
409
410 jobToRun = jobOn + "-pipeline-" + ( manuallyRun ? "manually" : wiki )
411 build job: jobToRun, propagate: false, parameters: [ [ $class: 'StringParameterValue', name: 'Category', value: jobOn ],
412 [ $class: 'StringParameterValue', name: 'Branch', value: branch ],
413 [ $class: 'StringParameterValue', name: 'TestStation', value: assignedNode ],
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -0700414 [ $class: 'StringParameterValue', name: 'NodeLabel', value: nodeLabel ],
415 [ $class: 'StringParameterValue', name: 'TimeOut', value: pipelineTimeOut.toString() ] ]
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700416}
417
418def trigger_pipeline( branch, tests, nodeLabel, jobOn, manuallyRun, onosTag ){
419 // nodeLabel : nodeLabel from tests.json
420 // jobOn : "SCPF" or "USECASE" or "FUNC" or "HA"
421 // this will return the function by wrapping them up with return{} to prevent them to be
422 // executed once this function is called to assign to specific variable.
423 return {
424 trigger( branch, tests, nodeLabel, jobOn, manuallyRun, onosTag )
425 }
426}
427
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700428def generateRunList(){
429 runList = [:]
Jeremy Ronquilloedb663b2019-06-26 14:09:38 -0700430 validSchedules = test_list.getValidSchedules( day )
431 echo "validSchedules: " + validSchedules
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700432 for ( branch in onos_branches ){
Jeremy Ronquilloa5aa7c12019-06-04 10:26:36 -0700433 runBranch = []
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700434 nodeLabels = test_list.getAllNodeLabels( branch, selectedTests )
435 for ( nodeLabel in nodeLabels ){
436 selectedNodeLabelTests = test_list.getTestsFromNodeLabel( nodeLabel, branch, selectedTests )
437 selectedNodeLabelCategories = test_list.getAllTestCategories( selectedNodeLabelTests )
438 for ( category in selectedNodeLabelCategories ){
Jeremy Ronquilloa5aa7c12019-06-04 10:26:36 -0700439 selectedNodeLabelCategoryTests = test_list.getTestsFromCategory( category, selectedNodeLabelTests )
Jeremy Ronquilloedb663b2019-06-26 14:09:38 -0700440
441 filteredList = [:]
442 for ( key in selectedNodeLabelCategoryTests.keySet() ){
443 for ( sch in selectedNodeLabelCategoryTests[ key ][ "schedules" ] ){
Jeremy Ronquillobd26bdb2019-07-08 16:15:45 -0700444 if ( validSchedules.contains( sch[ "day" ] ) && sch[ "branch" ] == test_list.convertBranchToBranchCode( branch ) || manually_run ){
Jeremy Ronquilloedb663b2019-06-26 14:09:38 -0700445 filteredList.put( key, selectedNodeLabelCategoryTests[ key ] )
446 break
447 }
448 }
449 }
450
Jeremy Ronquilloc3188b62019-08-19 15:51:17 -0700451 echo "========================================="
Jeremy Ronquilloedb663b2019-06-26 14:09:38 -0700452 echo "BRANCH: " + branch
453 echo "CATEGORY: " + category
454 echo "TESTS: " + filteredList
455 if ( filteredList != [:] ){
456 exeTestList = test_list.getTestListAsString( filteredList )
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700457 runList.put( branch + "-" + nodeLabel + "-" + category, trigger_pipeline( branch, exeTestList, nodeLabel, category, manually_run, onos_tag ) )
Jeremy Ronquilloedb663b2019-06-26 14:09:38 -0700458 }
459
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700460 }
Jeremy Ronquilloa37920b2019-05-23 14:34:25 -0700461 }
Devin Lim2edfcec2018-05-09 17:16:21 -0700462 }
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700463 return runList
Devin Lim2edfcec2018-05-09 17:16:21 -0700464}
Devin Limf5175192018-05-14 19:13:22 -0700465
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700466def runTests(){
467 runList = generateRunList()
468 printTestsToRun( runList )
469 parallel runList
Devin Lim2edfcec2018-05-09 17:16:21 -0700470}
Devin Limf5175192018-05-14 19:13:22 -0700471
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700472// ***************
473// Generate Graphs
474// ***************
Devin Lim2edfcec2018-05-09 17:16:21 -0700475
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700476def generateGraphs(){
477 // If it is automated running, it will generate the stats graph on VM.
478 if ( !manually_run ){
479 for ( String b in onos_branches ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700480 graphs.generateStatGraph( "TestStation-VMs",
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700481 test_list.addPrefixToBranch( b ),
Jeremy Ronquillo96e2bd32019-05-28 15:40:18 -0700482 graphPaths[ "histogramMultiple" ],
483 graphPaths[ "pieMultiple" ],
Jeremy Ronquillocfec28a2019-08-08 11:29:04 -0700484 graphPaths[ "saveDirectory" ],
485 "VM" )
Jeremy Ronquilloa37920b2019-05-23 14:34:25 -0700486 }
Devin Lim2edfcec2018-05-09 17:16:21 -0700487 }
Devin Lim2edfcec2018-05-09 17:16:21 -0700488}