Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 1 | #!groovy |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 2 | funcs = evaluate readTrusted( 'JenkinsCommonFuncs.groovy' ) |
| 3 | funcs.initialize( "FUNC" ); |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 4 | // This is a Jenkinsfile for a scripted pipeline for the FUNC tests |
| 5 | def prop = null |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 6 | prop = funcs.getProperties() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 7 | FUNC = [ |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 8 | "FUNCipv6Intent" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCipv6Intent", wiki_file:"FUNCipv6IntentWiki.txt" ], |
| 9 | "FUNCoptical" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCoptical", wiki_file:"FUNCopticalWiki.txt" ], |
| 10 | "FUNCflow" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCflow", wiki_file:"FUNCflowWiki.txt" ], |
| 11 | "FUNCnetCfg": [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCnetCfg", wiki_file:"FUNCnetCfgWiki.txt" ], |
| 12 | "FUNCovsdbtest" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCovsdbtestWiki", wiki_file:"FUNCovsdbtestWiki.txt" ], |
| 13 | "FUNCnetconf" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCnetconf", wiki_file:"FUNCnetconfWiki.txt" ], |
| 14 | "FUNCgroup" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCgroup", wiki_file:"FUNCgroupWiki.txt" ], |
| 15 | "FUNCintent" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCintent", wiki_file:"FUNCintentWiki.txt" ], |
| 16 | "FUNCintentRest" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCintentRest", wiki_file:"FUNCintentRestWiki.txt" ], |
| 17 | "FUNCformCluster" : [ wiki_link:prop[ "WikiPrefix" ] + "-" + "FUNCformCluster", wiki_file:"FUNCformClusterWiki.txt" ] |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 18 | ] |
Jeremy Ronquillo | 2d2649d | 2017-09-14 12:53:06 -0700 | [diff] [blame] | 19 | graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 20 | graph_saved_directory = "/var/jenkins/workspace/postjob-VM/" |
| 21 | echo( "Testcases:" ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 22 | def testsToRun = null |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 23 | testsToRun = funcs.getTestsToRun( prop[ "Tests" ] ) |
| 24 | funcs.printTestToRun( testsToRun ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 25 | |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 26 | def tests = [:] |
| 27 | for( String test : FUNC.keySet() ){ |
| 28 | toBeRun = testsToRun.contains( test ) |
| 29 | def stepName = ( toBeRun ? "" : "Not " ) + "Running $test" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 30 | tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, FUNC, graph_generator_file, graph_saved_directory ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 33 | start = funcs.getCurrentTime() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 34 | // run the tests |
| 35 | for ( test in tests.keySet() ){ |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 36 | tests[ test ].call() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 37 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame^] | 38 | funcs.generateOverallGraph( prop, FUNC, graph_saved_directory ) |
| 39 | funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] ) |