blob: 088f8eaf13899745e5324e81ede10b866f2952ad [file] [log] [blame]
Devin Lim431408d2018-03-23 17:51:31 -07001#!groovy
2
Devin Limfc4f22c2018-03-23 18:18:27 -07003funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
4test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
Devin Lim431408d2018-03-23 17:51:31 -07005triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/TriggerFuncs.groovy' )
6
Devin Lim9d18c972018-04-06 19:09:18 -07007current_version = "master"
Devin Lim431408d2018-03-23 17:51:31 -07008previous_version = "1.12"
9before_previous_version = "1.11"
10funcs.initializeTrend( "Fabric" );
11funcs.initialize( "Fabric" )
12triggerFuncs.init( funcs )
13
14wikiContents = ""
15testcases = [
16 "FUNC" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
17 "HA" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
18 "SCPF" : [ tests : "" , nodeName : "BM", wikiContent : "" ],
Devin Lim86e40532018-04-06 12:44:06 -070019 "SR" : [ tests : "", nodeName : [ "Fabric2", "Fabric3" ], wikiContent : "" ],
Devin Lim431408d2018-03-23 17:51:31 -070020 "USECASE" : [ tests : "" , nodeName : "BM", wikiContent : "" ]
21]
22Prefix_organizer = [
23 "FU" : "FUNC",
24 "HA" : "HA",
25 "PL" : "USECASE",
26 "SA" : "USECASE",
27 "SC" : "SCPF",
28 "SR" : "SR",
29 "US" : "USECASE",
30 "VP" : "USECASE"
31]
32
33manually_run = params.manual_run
34onos_b = "master"
35test_branch = ""
36onos_tag = params.ONOSTag
37isOldFlow = true
38
39// Set tests based on day of week
40def now = funcs.getCurrentTime()
41print now.toString()
42today = now[ Calendar.DAY_OF_WEEK ]
43
44if ( manually_run ){
45 onos_b = params.ONOSVersion
46}
47AllTheTests = test_lists.getAllTheTests( onos_b )
48
49day = ""
50SCPF_choices = ""
51USECASE_choices = ""
52FUNC_choices = ""
53HA_choices = ""
54SR_choices = ""
55stat_graph_generator_file = "testCategoryBuildStats.R"
56pie_graph_generator_file = "testCategoryPiePassFail.R"
57graph_saved_directory = "/var/jenkins/workspace/postjob-Fabric/"
58
59post_result = params.PostResult
60if( !manually_run ){
Devin Lim9d18c972018-04-06 19:09:18 -070061 slackSend( channel:'testing', color:'#03CD9F',
Devin Lim431408d2018-03-23 17:51:31 -070062 message:":sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:\n"
63 + "Starting tests on : " + now.toString()
64 + "\n:sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:" )
65
66 SR_choices += adder( "SR", "basic", true )
Devin Limbe483072018-03-24 14:37:48 -070067 if ( today == Calendar.FRIDAY ){
68 SR_choices += adder( "SR", "extra_A", true )
69 } else if( today == Calendar.SATURDAY ){
70 SR_choices += adder( "SR", "extra_B", true )
71 }
Devin Lim431408d2018-03-23 17:51:31 -070072 SR_choices = triggerFuncs.lastCommaRemover( SR_choices )
73}
74if ( manually_run ){
75 testcases = triggerFuncs.organize_tests( params.Tests, testcases )
76
77 isOldFlow = params.isOldFlow
78 println "Tests to be run manually : "
79}else{
80 testcases[ "SR" ][ "tests" ] = SR_choices
81 println "Defaulting to " + day + " tests:"
82}
83
84triggerFuncs.print_tests( testcases )
85
86def runTest = [
87 "VM" : [:],
88 "BM" : [:],
Devin Lim86e40532018-04-06 12:44:06 -070089 "Fabric2" : [:],
90 "Fabric3" : [:]
Devin Lim431408d2018-03-23 17:51:31 -070091]
92for( String test in testcases.keySet() ){
93 println test
94 if ( testcases[ test ][ "tests" ] != "" ){
Devin Lim9d18c972018-04-06 19:09:18 -070095 runTest[ testcases[ test ][ "nodeName" ][ 0 ] ][ test ] = triggerFuncs.trigger_pipeline( current_version, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ][ 0 ], test, manually_run, onos_tag )
Devin Lim86e40532018-04-06 12:44:06 -070096 runTest[ testcases[ test ][ "nodeName" ][ 1 ] ][ test ] = triggerFuncs.trigger_pipeline( previous_version, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ][ 1 ], test, manually_run, onos_tag )
Devin Lim431408d2018-03-23 17:51:31 -070097 }
98}
99def finalList = [:]
Devin Lim86e40532018-04-06 12:44:06 -0700100finalList[ "Fabric2" ] = triggerFuncs.runTestSeq( runTest[ "Fabric2" ] )
101finalList[ "Fabric3" ] = triggerFuncs.runTestSeq( runTest[ "Fabric3" ] )
Devin Lim431408d2018-03-23 17:51:31 -0700102parallel finalList
103/*
104if ( !manually_run ){
Devin Lim86e40532018-04-06 12:44:06 -0700105 funcs.generateStatGraph( "TestStation-Fabric2s",
106 funcs.branchWithPrefix( "master" ),
107 AllTheTests,
108 stat_graph_generator_file,
109 pie_graph_generator_file,
110 graph_saved_directory )
111 funcs.generateStatGraph( "TestStation-Fabric3s",
112 funcs.branchWithPrefix( "1.12" ),
Devin Lim431408d2018-03-23 17:51:31 -0700113 AllTheTests,
114 stat_graph_generator_file,
115 pie_graph_generator_file,
116 graph_saved_directory )
117}*/
118def adder( testCat, set, getResult ){
119 result = ""
120 for( String test in AllTheTests[ testCat ].keySet() ){
121 if( AllTheTests[ testCat ][ test ][ set ] ){
122 if( getResult )
123 result += test + ","
124 }
125 }
126 return result
127}