blob: 1201c9228aaf403526fea81d3a382b62f27de2ce [file] [log] [blame]
Devin Lim90803a82017-08-29 13:41:44 -07001#!groovy
Devin Lim61643762017-12-07 15:55:38 -08002funcs = evaluate readTrusted( 'JenkinsCommonFuncs.groovy' )
3funcs.initialize( "FUNC" );
Devin Lim90803a82017-08-29 13:41:44 -07004// This is a Jenkinsfile for a scripted pipeline for the FUNC tests
5def prop = null
Devin Lim61643762017-12-07 15:55:38 -08006prop = funcs.getProperties()
Devin Lim90803a82017-08-29 13:41:44 -07007FUNC = [
Devin Lim61643762017-12-07 15:55:38 -08008"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 Lim90803a82017-08-29 13:41:44 -070018]
Jeremy Ronquillo2d2649d2017-09-14 12:53:06 -070019graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
Devin Lim61643762017-12-07 15:55:38 -080020graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
21echo( "Testcases:" )
Devin Lim90803a82017-08-29 13:41:44 -070022def testsToRun = null
Devin Lim61643762017-12-07 15:55:38 -080023testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
24funcs.printTestToRun( testsToRun )
Devin Lim90803a82017-08-29 13:41:44 -070025
Devin Lim90803a82017-08-29 13:41:44 -070026def tests = [:]
27for( String test : FUNC.keySet() ){
28 toBeRun = testsToRun.contains( test )
29 def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
Devin Lim61643762017-12-07 15:55:38 -080030 tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, FUNC, graph_generator_file, graph_saved_directory )
Devin Lim90803a82017-08-29 13:41:44 -070031}
32
Devin Lim61643762017-12-07 15:55:38 -080033start = funcs.getCurrentTime()
Devin Lim90803a82017-08-29 13:41:44 -070034// run the tests
35for ( test in tests.keySet() ){
Devin Lim61643762017-12-07 15:55:38 -080036 tests[ test ].call()
Devin Lim90803a82017-08-29 13:41:44 -070037}
Devin Lim61643762017-12-07 15:55:38 -080038funcs.generateOverallGraph( prop, FUNC, graph_saved_directory )
39funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] )