blob: 59a91ca841cb0d87e0c4ccdf9afecc956d6446b6 [file] [log] [blame]
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -07001#!groovy
2// Copyright 2017 Open Networking Foundation (ONF)
3//
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 Ronquillo336110a2019-07-11 14:20:40 -070021import groovy.time.TimeCategory
22import groovy.time.TimeDuration
23
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070024// read the dependency files
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070025graphs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsGraphs.groovy' )
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070026test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' )
27fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' )
28SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
29
30category = null
31prop = null
32testsToRun = null
Jeremy Ronquilloa8490fb2019-06-26 11:59:50 -070033testsToRunStrList = null
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070034branch = null
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070035branchWithPrefix = null
Jeremy Ronquilloa8490fb2019-06-26 11:59:50 -070036start = null
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070037nodeLabel = null
Jeremy Ronquillo6fbfdd52019-07-09 13:49:34 -070038testStation = null
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070039testsOverride = null
40isGraphOnly = false
41isSCPF = false
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -070042pipelineTimeout = null
43
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070044testsFromList = [:]
45graphPaths = [:]
46pipeline = [:]
47
48main()
49
50def main(){
Jeremy Ronquillo892c1732019-07-29 15:22:57 -070051 pipelineTimeout = params.TimeOut.toInteger() // integer minutes until the entire pipeline times out. Usually passed from upstream master-trigger job.
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -070052 timeout( time: pipelineTimeout, unit: "MINUTES" ){
Jeremy Ronquillo892c1732019-07-29 15:22:57 -070053 init()
Jeremy Ronquillo6da78cf2019-07-29 11:47:19 -070054 runTests()
55 generateGraphs()
56 sendToSlack()
57 }
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070058}
59
60def init(){
61 fileRelated.init()
62 test_list.init()
63 readParams()
64
Jeremy Ronquillob8aac442019-07-31 13:28:01 -070065 if ( branch == "manually" ){
66 echo '''Warning: entered branch was: "manually". Defaulting to master branch.'''
67 branch = "master"
68 branchWithPrefix = test_list.addPrefixToBranch( branch )
69 }
70
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070071 if ( category == "SCPF" ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070072 isSCPF = true
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070073 SCPFfuncs.init()
Jeremy Ronquillo442ce4d2019-07-26 16:35:11 -070074 graphs.initialize( SCPFfuncs );
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070075 prop = getProperties()
76 isOldFlow = ( prop[ "isOldFlow" ] == "true" )
Jeremy Ronquilloa8490fb2019-06-26 11:59:50 -070077 SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ] )
Jeremy Ronquilloa8490fb2019-06-26 11:59:50 -070078 } else {
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070079 isSCPF = false
80 graphs.initialize()
81 prop = getProperties()
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070082 }
83
Jeremy Ronquillob8aac442019-07-31 13:28:01 -070084 // get the list of the tests from category
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070085 testsFromList = test_list.getTestsFromCategory( category )
86
87 initGraphPaths()
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070088 tokenizeTokens = "\n;, "
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070089
Jeremy Ronquillo336110a2019-07-11 14:20:40 -070090 if ( testsOverride == "" || testsOverride == null ){
91 testsToRunStrList = prop[ "Tests" ].tokenize( tokenizeTokens )
92 } else {
93 testsToRunStrList = testsOverride.tokenize( tokenizeTokens )
94 }
Jeremy Ronquilloa8490fb2019-06-26 11:59:50 -070095 testsToRun = test_list.getTestsFromStringList( testsToRunStrList )
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -070096}
97
98def readParams(){
Jeremy Ronquillo6fbfdd52019-07-09 13:49:34 -070099 category = params.Category // "FUNC", "HA", "USECASE", etc.
100 branch = params.Branch // "1.15", "2.1", "master", etc.
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700101 branchWithPrefix = test_list.addPrefixToBranch( branch )
Jeremy Ronquillo6fbfdd52019-07-09 13:49:34 -0700102 testStation = params.TestStation // "TestStation-BMs", etc.
103 nodeLabel = params.NodeLabel // "BM", "VM", "Fabric-1.x", etc.
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700104 testsOverride = params.TestsOverride // "FUNCflow, FUNCintent, [...]", overrides property file
105 isGraphOnly = params.OnlyRefreshGraphs // true or false
106}
107
108def getProperties(){
109 // get the properties of the test by reading the TestONOS.property
110
111 filePath = '''/var/jenkins/TestONOS-''' + category + '''-''' + branchWithPrefix + '''.property'''
112
113 node( testStation ) {
114 return readProperties( file: filePath )
115 }
116}
117
118def getCurrentTime(){
119 // get time of the PST zone.
120
121 TimeZone.setDefault( TimeZone.getTimeZone( 'PST' ) )
122 return new Date()
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700123}
124
125def initGraphPaths(){
Jeremy Ronquillo1e5d7f22019-07-17 14:18:42 -0700126 graphPaths.put( "trendIndividual", fileRelated.rScriptPaths[ "scripts" ][ "trendIndividual" ] )
Jon Halla15854a2020-07-23 15:47:00 -0700127 if ( category == "SR" || category == "SR-StratumBMv2" ){
Jeremy Ronquillo1e5d7f22019-07-17 14:18:42 -0700128 graphPaths.put( "saveDirectory", fileRelated.workspaces[ "base" ] + "postjob-" + ( testStation - "TestStation-" - "s" ) + "/" )
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700129 } else if ( category == "SRHA" ) {
Jeremy Ronquillo1e5d7f22019-07-17 14:18:42 -0700130 graphPaths.put( "saveDirectory", fileRelated.workspaces[ "Fabric" ] )
Jeremy Ronquillobb3001f2019-07-01 12:57:07 -0700131 } else if ( category == "SCPF" || category == "USECASE" ){
Jeremy Ronquillo1e5d7f22019-07-17 14:18:42 -0700132 graphPaths.put( "saveDirectory", fileRelated.workspaces[ "BM" ] )
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700133 } else {
Jeremy Ronquillo1e5d7f22019-07-17 14:18:42 -0700134 graphPaths.put( "saveDirectory", fileRelated.workspaces[ "VM" ] )
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700135 }
136}
137
138def runTests(){
139 // run the test sequentially and save the function into the dictionary.
Jeremy Ronquillob8aac442019-07-31 13:28:01 -0700140 for ( String test : testsFromList.keySet() ){
141 toBeRun = testsToRun.keySet().contains( test )
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700142 stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
Jon Hall1ef76322020-07-24 12:26:04 -0700143 // pureTestName is what is passed to the cli, here we check to see if there are any params to pass as well
144 if ( test.contains( "WithFlowObj" ) ){
145 pureTestName = test - "WithFlowObj"
Jon Hall87269aa2020-07-24 15:30:07 -0700146 } else if ( toBeRun && testsToRun[ test ].keySet().contains( "test" ) ){
Jon Hall1ef76322020-07-24 12:26:04 -0700147 pureTestName = testsToRun[ test ][ "test" ]
148 } else {
149 pureTestName = test
150 }
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700151 pipeline[ stepName ] = runTest( test,
152 toBeRun,
153 prop,
154 pureTestName,
155 isGraphOnly,
156 testsToRun,
157 graphPaths[ "trendIndividual" ],
158 graphPaths[ "saveDirectory" ] )
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700159 }
160
161 // get the start time of the test.
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700162 start = getCurrentTime()
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700163
164 // run the tests sequentially.
165 for ( test in pipeline.keySet() ){
166 pipeline[ test ].call()
167 }
168}
169
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700170def initTest(){
171 return '''#!/bin/bash -l
172 set -i # interactive
173 set +e
174 shopt -s expand_aliases # expand alias in non-interactive mode
175 export PYTHONUNBUFFERED=1
176 ifconfig
177 echo "ONOS Branch is: $ONOSBranch"
178 echo "TestON Branch is: $TestONBranch"
179 echo "Test date: "
180 date
181 cd ~
182 export PATH=$PATH:onos/tools/test/bin
183 timeout 240 stc shutdown | head -100
184 timeout 240 stc teardown | head -100
185 timeout 240 stc shutdown | head -100
186 cd ~/OnosSystemTest/TestON/bin
187 git log | head
188 ./cleanup.sh -f || true
189 '''
190}
191
Jeremy Ronquillo5ceda072019-08-12 12:56:43 -0700192def configureJavaVersion(){
193 java_1_8_branches = [ "1.15" ]
194 return '''#!/bin/bash -l
195 ''' + ( java_1_8_branches.contains( branch ) ? '''SET_JAVA_VER=java-8-oracle''' : '''SET_JAVA_VER=java-1.11.0-openjdk-amd64''' ) +
196 '''
197 CELL_COUNT=$( env | egrep "OC[1-9]+" | wc -l )
198 for i in $(seq 1 $CELL_COUNT)
199 do
200 CELL_TO_SET=$( env | egrep "OC$i" | cut -c5- )
201 echo "Setting java to $SET_JAVA_VER on $CELL_TO_SET"
202 eval ssh $CELL_TO_SET 'sudo update-java-alternatives -s $SET_JAVA_VER'
203 done
204 '''
205}
206
Jeremy Ronquillo31a3eb32019-08-02 13:30:37 -0700207def runTestCli_py( testName, pureTestName, testCategory ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700208 // Bash script that will run the test.
209 // testName : name of the test
210 // testCategory : (SR,FUNC ... )
Jeremy Ronquillo31a3eb32019-08-02 13:30:37 -0700211 flowObjFlag = false
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700212
Jeremy Ronquillo31a3eb32019-08-02 13:30:37 -0700213 if ( isSCPF && testName.contains( "WithFlowObj" ) ){
214 flowObjFlag = true
215 }
216
217 command = '''cd ~/OnosSystemTest/TestON/bin
218 ./cli.py run ''' + pureTestName + ''' --params''' + ( flowObjFlag ? '''TEST/flowObj=True ''' : ''' ''' ) + '''GRAPH/nodeCluster=''' + graphs.getPostjobType( nodeLabel ) + ''' '''
219 echo command
220
221 return command
222
223
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700224}
225
226def concludeRunTest(){
227 return '''cd ~/OnosSystemTest/TestON/bin
228 ./cleanup.sh -f || true
229 # cleanup config changes
230 cd ~/onos/tools/package/config
231 git clean -df'''
232}
233
234def copyLogs(){
235 // bash script to copy the logs and other necessary element for SR tests.
236
237 result = ""
Jon Halla15854a2020-07-23 15:47:00 -0700238 if ( category == "SR" || category == "SR-StratumBMv2" ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700239 result = '''
240 sudo rm /var/jenkins/workspace/SR-log-${WikiPrefix}/*
241 sudo cp *karaf.log.* /var/jenkins/workspace/SR-log-${WikiPrefix}/
242 sudo cp *Flows* /var/jenkins/workspace/SR-log-${WikiPrefix}/
243 sudo cp *Groups* /var/jenkins/workspace/SR-log-${WikiPrefix}/
244 sudo cp *.tar.gz /var/jenkins/workspace/SR-log-${WikiPrefix}/
245 sudo cp t3-* /var/jenkins/workspace/SR-log-${WikiPrefix}/
246 '''
247 }
248 return result
249}
250
251def cleanAndCopyFiles( testName ){
252 // clean up some files that were in the folder and copy the new files from the log
253 // testName : name of the test
254
255 return '''#!/bin/bash -i
256 set +e
257 echo "ONOS Branch is: ${ONOSBranch}"
258 echo "TestON Branch is: ${TestONBranch}"
259 echo "Job name is: "''' + testName + '''
260 echo "Workspace is: ${WORKSPACE}/"
261 echo "Wiki page to post is: ${WikiPrefix}-"
262 # remove any leftover files from previous tests
263 sudo rm ${WORKSPACE}/*Wiki.txt
264 sudo rm ${WORKSPACE}/*Summary.txt
265 sudo rm ${WORKSPACE}/*Result.txt
266 sudo rm ${WORKSPACE}/*Alarm.txt || true
267 sudo rm ${WORKSPACE}/*.csv
268 #copy files to workspace
269 cd `ls -t ~/OnosSystemTest/TestON/logs/*/ | head -1 | sed 's/://'`
270 ''' + copyLogs() + '''
271 sudo cp *.txt ${WORKSPACE}/
272 sudo cp *.csv ${WORKSPACE}/
273 cd ${WORKSPACE}/
274 for i in *.csv
275 do mv "$i" "$WikiPrefix"-"$i"
276 done
277 ls -al
278 cd '''
279}
280
281def fetchLogs( testName ){
282 // fetch the logs of onos from onos nodes to onos System Test logs
283 // testName: name of the test
284
285 return '''#!/bin/bash
286 set +e
287 cd ~/OnosSystemTest/TestON/logs
288 echo "TestON test name is: "''' + testName + '''
289 TestONlogDir=$(ls -t | grep ${TEST_NAME}_ |head -1)
290 echo "########################################################################################"
291 echo "##### copying ONOS logs from all nodes to TestON/logs directory: ${TestONlogDir}"
292 echo "########################################################################################"
293 cd $TestONlogDir
294 if [ $? -eq 1 ]
295 then
296 echo "Job name does not match any test suite name to move log!"
297 else
298 pwd
299 for i in $OC{1..7}; do onos-fetch-logs $i || echo log does not exist for onos $i; done
300 for i in $OC{1..7}; do atomix-fetch-logs $i || echo log does not exist for atomix $i; done
301 fi
302 cd'''
303}
304
305def publishToConfluence( isManualRun, isPostResult, wikiLink, file ){
306 // publish HTML script to wiki confluence
307 // isManualRun : string "true" "false"
308 // isPostResult : string "true" "false"
309 // wikiLink : link of the wiki page to publish
310 // file : name of the file to be published
311
Jeremy Ronquillo31a3eb32019-08-02 13:30:37 -0700312 if ( graphs.isPostingResult( isManualRun, isPostResult ) ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700313 publishConfluence siteName: 'wiki.onosproject.org', pageName: wikiLink, spaceName: 'ONOS',
314 attachArchivedArtifacts: true, buildIfUnstable: true,
315 editorList: [ confluenceWritePage( confluenceFile( file ) ) ]
316 }
317}
318
319def postLogs( testName, prefix ){
320 // posting logs of the onos jobs specifically SR tests
321 // testName : name of the test
322 // prefix : branch prefix ( master, 2.1, 1.15 ... )
323
324 resultURL = ""
Jon Halla15854a2020-07-23 15:47:00 -0700325 if ( category == "SR" || category == "SR-StratumBMv2" ){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700326 def post = build job: "SR-log-" + prefix, propagate: false
327 resultURL = post.getAbsoluteUrl()
328 }
329 return resultURL
330}
331
332def analyzeResult( prop, workSpace, pureTestName, testName, resultURL, wikiLink, isSCPF ){
333 // analyzing the result of the test and send to slack if any abnormal result is logged.
334 // prop : property dictionary
335 // workSpace : workSpace where the result file is saved
336 // pureTestName : TestON name of the test
337 // testName : Jenkins name of the test. Example: SCPFflowTPFobj
338 // resultURL : url for the logs for SR tests. Will not be posted if it is empty
339 // wikiLink : link of the wiki page where the result was posted
340 // isSCPF : Check if it is SCPF. If so, it won't post the wiki link.
341
342 node( testStation ) {
343 def alarmFile = workSpace + "/" + pureTestName + "Alarm.txt"
344 if ( fileExists( alarmFile ) ) {
345 def alarmContents = readFile( alarmFile )
346 slackSend( channel: "#jenkins-related",
347 color: "FF0000",
348 message: "[" + prop[ "ONOSBranch" ] + "]" + testName + " : triggered alarms:\n" +
349 alarmContents + "\n" +
350 "[TestON log] : \n" +
351 "https://jenkins.onosproject.org/blue/organizations/jenkins/${ env.JOB_NAME }/detail/${ env.JOB_NAME }/${ env.BUILD_NUMBER }/pipeline" +
352 ( isSCPF ? "" : ( "\n[Result on Wiki] : \n" +
353 "https://wiki.onosproject.org/display/ONOS/" +
354 wikiLink.replaceAll( "\\s", "+" ) ) ) +
355 ( resultURL != "" ? ( "\n[Karaf log] : \n" +
356 resultURL + "artifact/" ) : "" ),
357 teamDomain: 'onosproject' )
Jeremy Ronquilloe4e83912019-07-29 12:58:48 -0700358 print "Abnormal test result."
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700359 throw new Exception( "Abnormal test result." )
360 }
361 else {
362 print "Test results are OK."
363 }
364 }
365}
366
367def runTest( testName, toBeRun, prop, pureTestName, graphOnly, testCategory, graph_generator_file,
368 graph_saved_directory ){
369 // run the test on the machine that contains all the steps : init and run test, copy files, publish result ...
370 // testName : name of the test in Jenkins
371 // toBeRun : boolean value whether the test will be run or not. If not, it won't be run but shows up with empty
372 // result on pipeline view
373 // prop : dictionary property on the machine
374 // pureTestName : Pure name of the test. ( ex. pureTestName of SCPFflowTpFobj will be SCPFflowTp )
375 // graphOnly : check if it is generating graph job. If so, it will only generate the generating graph part
376 // testCategory : Map for the test suit ( SCPF, SR, FUNC, ... ) which contains information about the tests
377 // graph_generator_file : Rscript file with the full path.
378 // graph_saved_directory : where the generated graph will be saved to.
379
380 return {
381 catchError {
382 stage( testName ) {
383 if ( toBeRun ){
384 def workSpace = "/var/jenkins/workspace/" + testName
385 def fileContents = ""
386 node( testStation ) {
387 withEnv( [ 'ONOSBranch=' + prop[ "ONOSBranch" ],
388 'ONOSJAVAOPTS=' + prop[ "ONOSJAVAOPTS" ],
389 'TestONBranch=' + prop[ "TestONBranch" ],
390 'ONOSTag=' + prop[ "ONOSTag" ],
391 'WikiPrefix=' + prop[ "WikiPrefix" ],
392 'WORKSPACE=' + workSpace ] ) {
393 if ( !graphOnly ){
394 if ( isSCPF ){
395 // Remove the old database file
396 sh SCPFfuncs.cleanupDatabaseFile( testName )
397 }
Jeremy Ronquillo5ceda072019-08-12 12:56:43 -0700398 sh script: configureJavaVersion(), label: "Configure Java Version"
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700399 sh script: initTest(), label: "Test Initialization: stc shutdown; stc teardown; ./cleanup.sh"
400 catchError{
Jeremy Ronquillo31a3eb32019-08-02 13:30:37 -0700401 sh script: runTestCli_py( testName, pureTestName, testCategory ), label: ( "Run Test: ./cli.py run " + testName )
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700402 }
403 catchError{
404 sh script: concludeRunTest(), label: "Conclude Running Test: ./cleanup.sh; git clean -df"
405 }
406 catchError{
407 // For the Wiki page
408 sh script: cleanAndCopyFiles( pureTestName ), label: "Clean and Copy Files"
409 }
410 }
411 graphs.databaseAndGraph( prop, testName, pureTestName, graphOnly,
412 graph_generator_file, graph_saved_directory )
413 if ( !graphOnly ){
414 sh script: fetchLogs( pureTestName ), label: "Fetch Logs"
415 if ( !isSCPF ){
416 publishToConfluence( prop[ "manualRun" ], prop[ "postResult" ],
417 prop[ "WikiPrefix" ] + "-" + testCategory[ testName ][ 'wikiName' ],
418 workSpace + "/" + testCategory[ testName ][ 'wikiFile' ] )
419 }
420 }
421 }
422 }
423 graphs.postResult( prop, graphOnly, nodeLabel )
424 if ( !graphOnly ){
425 def resultURL = postLogs( testName, prop[ "WikiPrefix" ] )
426 analyzeResult( prop, workSpace, pureTestName, testName, resultURL,
427 isSCPF ? "" : testCategory[ testName ][ 'wikiName' ],
428 isSCPF )
429 }
Jeremy Ronquillob8aac442019-07-31 13:28:01 -0700430 } else {
431 echo testName + " is not being run today. Leaving the rest of stage contents blank."
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700432 }
433 }
434 }
435 }
436}
437
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700438def generateGraphs(){
Jeremy Ronquillo06950992019-07-09 11:16:49 -0700439 if ( category != "SCPF" ){
440 // generate the overall graph of the non SCPF tests.
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700441 graphs.generateOverallGraph( prop, testsToRun, graphPaths[ "saveDirectory" ], nodeLabel, category )
Jeremy Ronquillobb3001f2019-07-01 12:57:07 -0700442 }
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700443}
444
445def sendToSlack(){
Jeremy Ronquillo336110a2019-07-11 14:20:40 -0700446 // send the result of the test to the slack when it is not manually running.
447 // start : start time of the test
448 // isManualRun : string that is whether "false" or "true"
449 // branch : branch of the onos.
450
451 try {
452 if ( prop[ "manualRun" ] == "false" ){
453 end = getCurrentTime()
454 TimeDuration duration = TimeCategory.minus( end, start )
455 // FIXME: for now we disable notifications of normal test results
456 /*
457 slackSend( color: "#5816EE",
458 message: category + "-" + prop[ "WikiPrefix" ] + " tests ended at: " + end.toString() +
459 "\nTime took : " + duration )
460 */
461 }
462 }
463 catch ( all ){
464 }
Jeremy Ronquillo21c29fc2019-06-05 11:15:24 -0700465}