blob: 336e237aff70d88acac1f19a55850ab1adb0882c [file] [log] [blame]
Devin Lim90803a82017-08-29 13:41:44 -07001#!groovy
Devin Lim61643762017-12-07 15:55:38 -08002
Devin Lim81ab48b2018-02-09 14:24:57 -08003funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -08004test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
Devin Lim431408d2018-03-23 17:51:31 -07005triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/TriggerFuncs.groovy' )
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -08006
You Wang9af16482018-05-02 13:45:28 -07007current_version = "master"
Devin Lim7f75f4b2018-04-20 11:34:37 -07008previous_version = "1.13"
You Wang9af16482018-05-02 13:45:28 -07009before_previous_version = "1.12"
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -080010funcs.initializeTrend( "VM" );
Devin Lim431408d2018-03-23 17:51:31 -070011triggerFuncs.init( funcs )
Devin Lime89761a2018-03-16 17:52:57 -070012wikiContents = ""
Devin Lim90803a82017-08-29 13:41:44 -070013testcases = [
Devin Lime89761a2018-03-16 17:52:57 -070014 "FUNC" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
15 "HA" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
16 "SCPF" : [ tests : "" , nodeName : "BM", wikiContent : "" ],
Devin Lim431408d2018-03-23 17:51:31 -070017 "SR" : [ tests : "", nodeName : "Fabric", wikiContent : "" ],
Devin Lime89761a2018-03-16 17:52:57 -070018 "USECASE" : [ tests : "" , nodeName : "BM", wikiContent : "" ]
Devin Lim90803a82017-08-29 13:41:44 -070019]
20Prefix_organizer = [
21 "FU" : "FUNC",
22 "HA" : "HA",
23 "PL" : "USECASE",
24 "SA" : "USECASE",
25 "SC" : "SCPF",
Devin Lim61643762017-12-07 15:55:38 -080026 "SR" : "SR",
Devin Lim90803a82017-08-29 13:41:44 -070027 "US" : "USECASE",
28 "VP" : "USECASE"
29]
30
Jeremy Ronquillocdd177d2018-03-09 16:55:44 -080031manually_run = params.manual_run
Devin Lim7f75f4b2018-04-20 11:34:37 -070032onos_b = current_version
Devin Lim0e967162017-11-03 15:59:53 -070033test_branch = ""
Devin Lima0e52eb2017-09-13 18:35:12 -070034onos_tag = params.ONOSTag
Devin Lim61643762017-12-07 15:55:38 -080035isOldFlow = true
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -080036
Devin Lim90803a82017-08-29 13:41:44 -070037// Set tests based on day of week
Devin Limd1fb8e92018-02-28 16:29:33 -080038def now = funcs.getCurrentTime()
39print now.toString()
Devin Lim61643762017-12-07 15:55:38 -080040today = now[ Calendar.DAY_OF_WEEK ]
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -080041
Jeremy Ronquillocdd177d2018-03-09 16:55:44 -080042if ( manually_run ){
43 onos_b = params.ONOSVersion
44} else {
45 if ( today == Calendar.SATURDAY ){
46 onos_b = previous_version
47 } else if( today == Calendar.SUNDAY ){
48 onos_b = before_previous_version
49 }
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -080050}
51AllTheTests = test_lists.getAllTheTests( onos_b )
52
Devin Lim90803a82017-08-29 13:41:44 -070053day = ""
Devin Lim61657e42017-10-09 17:24:40 -070054SCPF_choices = ""
Devin Lim90803a82017-08-29 13:41:44 -070055USECASE_choices = ""
Devin Lim61657e42017-10-09 17:24:40 -070056FUNC_choices = ""
57HA_choices = ""
Devin Lim61643762017-12-07 15:55:38 -080058SR_choices = ""
59stat_graph_generator_file = "testCategoryBuildStats.R"
60pie_graph_generator_file = "testCategoryPiePassFail.R"
61graph_saved_directory = "/var/jenkins/workspace/postjob-VM/"
Devin Lim90803a82017-08-29 13:41:44 -070062
Devin Lim90803a82017-08-29 13:41:44 -070063post_result = params.PostResult
Devin Lim61657e42017-10-09 17:24:40 -070064if( !manually_run ){
Devin Lim61643762017-12-07 15:55:38 -080065 slackSend( color:'#03CD9F',
66 message:":sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:\n"
67 + "Starting tests on : " + now.toString()
68 + "\n:sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:" )
Devin Lim61657e42017-10-09 17:24:40 -070069 testDivider( today )
Devin Lim431408d2018-03-23 17:51:31 -070070 FUNC_choices = triggerFuncs.lastCommaRemover( FUNC_choices )
71 HA_choices = triggerFuncs.lastCommaRemover( HA_choices )
72 SCPF_choices = triggerFuncs.lastCommaRemover( SCPF_choices )
73 USECASE_choices = triggerFuncs.lastCommaRemover( USECASE_choices )
74 SR_choices = triggerFuncs.lastCommaRemover( SR_choices )
Devin Lim61657e42017-10-09 17:24:40 -070075}
76
Devin Lim90803a82017-08-29 13:41:44 -070077if ( manually_run ){
Devin Lim431408d2018-03-23 17:51:31 -070078 testcases = triggerFuncs.organize_tests( params.Tests, testcases )
Jeremy Ronquillocdd177d2018-03-09 16:55:44 -080079
Devin Lim0e967162017-11-03 15:59:53 -070080 isOldFlow = params.isOldFlow
Devin Lim90803a82017-08-29 13:41:44 -070081 println "Tests to be run manually : "
82}else{
Devin Lim61643762017-12-07 15:55:38 -080083 testcases[ "SCPF" ][ "tests" ] = SCPF_choices
84 testcases[ "USECASE" ][ "tests" ] = USECASE_choices
85 testcases[ "FUNC" ][ "tests" ] = FUNC_choices
86 testcases[ "HA" ][ "tests" ] = HA_choices
87 testcases[ "SR" ][ "tests" ] = SR_choices
Devin Lim90803a82017-08-29 13:41:44 -070088 println "Defaulting to " + day + " tests:"
89}
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -080090
Devin Lim431408d2018-03-23 17:51:31 -070091triggerFuncs.print_tests( testcases )
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -080092
Devin Lim37a83792017-10-26 16:38:21 -070093def runTest = [
94 "VM" : [:],
95 "BM" : [:]
96]
97for( String test in testcases.keySet() ){
98 println test
Devin Lim61643762017-12-07 15:55:38 -080099 if ( testcases[ test ][ "tests" ] != "" ){
Devin Lim431408d2018-03-23 17:51:31 -0700100 runTest[ testcases[ test ][ "nodeName" ] ][ test ] = triggerFuncs.trigger_pipeline( onos_b, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ], test, manually_run, onos_tag )
Devin Lim37a83792017-10-26 16:38:21 -0700101 }
102}
103def finalList = [:]
Devin Lim431408d2018-03-23 17:51:31 -0700104finalList[ "VM" ] = triggerFuncs.runTestSeq( runTest[ "VM" ] )
105finalList[ "BM" ] = triggerFuncs.runTestSeq( runTest[ "BM" ] )
Devin Lim37a83792017-10-26 16:38:21 -0700106parallel finalList
Devin Lim61643762017-12-07 15:55:38 -0800107//finalList[ "BM" ].call()
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -0800108
109if ( !manually_run ){
Devin Lim86e40532018-04-06 12:44:06 -0700110 funcs.generateStatGraph( "TestStation-VMs",
111 funcs.branchWithPrefix( onos_b ),
Jeremy Ronquillof78a6ca2018-03-12 09:20:57 -0700112 AllTheTests,
113 stat_graph_generator_file,
114 pie_graph_generator_file,
115 graph_saved_directory )
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -0800116}
Devin Lim90803a82017-08-29 13:41:44 -0700117
Devin Lim61657e42017-10-09 17:24:40 -0700118def testDivider( today ){
Devin Lim61643762017-12-07 15:55:38 -0800119 switch ( today ) {
Devin Lim61657e42017-10-09 17:24:40 -0700120 case Calendar.MONDAY:
Devin Lime89761a2018-03-16 17:52:57 -0700121 initHtmlForWiki()
Devin Lim61657e42017-10-09 17:24:40 -0700122 monday( true )
123 tuesday( true, false )
124 wednesday( true, false )
125 thursday( true, false )
126 friday( true, false )
Devin Lime89761a2018-03-16 17:52:57 -0700127 saturday( false, false )
128 sunday( false, false )
Devin Lim61657e42017-10-09 17:24:40 -0700129 day = "Monday"
Devin Lime89761a2018-03-16 17:52:57 -0700130 closeHtmlForWiki()
131 postToWiki( wikiContents )
Devin Lim19d46ba2018-04-02 20:52:13 -0700132 slackSend( color:'#FFD988', message:"Tests to be run this weekdays : \n" + triggerFuncs.printDaysForTest( AllTheTests ) )
Devin Lim61657e42017-10-09 17:24:40 -0700133 break
134 case Calendar.TUESDAY:
Devin Lime89761a2018-03-16 17:52:57 -0700135 tuesday( false, true )
Devin Lim61657e42017-10-09 17:24:40 -0700136 day = "Tuesday"
137 break
138 case Calendar.WEDNESDAY:
Devin Lime89761a2018-03-16 17:52:57 -0700139 wednesday( false, true )
Devin Lim61657e42017-10-09 17:24:40 -0700140 day = "Wednesday"
141 break
142 case Calendar.THURSDAY:
Devin Lime89761a2018-03-16 17:52:57 -0700143 thursday( false, true )
Devin Lim61657e42017-10-09 17:24:40 -0700144 day = "Thursday"
145 break
146 case Calendar.FRIDAY:
Devin Lime89761a2018-03-16 17:52:57 -0700147 friday( false, true )
Devin Lim61657e42017-10-09 17:24:40 -0700148 day = "Friday"
149 break
150 case Calendar.SATURDAY:
Devin Lime89761a2018-03-16 17:52:57 -0700151 saturday( false, true )
Devin Lim61657e42017-10-09 17:24:40 -0700152 day = "Saturday"
153 break
154 case Calendar.SUNDAY:
Devin Lime89761a2018-03-16 17:52:57 -0700155 sunday( false , true )
Devin Lim61657e42017-10-09 17:24:40 -0700156 day = "Sunday"
157 break
158 }
159}
Devin Lim61657e42017-10-09 17:24:40 -0700160def monday( getResult ){
Devin Lime89761a2018-03-16 17:52:57 -0700161 addingHeader( "FUNC" )
Devin Lim61657e42017-10-09 17:24:40 -0700162 FUNC_choices += adder( "FUNC", "basic", true, "M", getResult )
163 FUNC_choices += adder( "FUNC", "extra_A", true, "M", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700164 closingHeader( "FUNC" )
165 addingHeader( "HA" )
Devin Lim61657e42017-10-09 17:24:40 -0700166 HA_choices += adder( "HA", "basic", true, "M", getResult )
167 HA_choices += adder( "HA", "extra_A", true, "M", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700168 closingHeader( "HA" )
169 addingHeader( "SCPF" )
Devin Lim61657e42017-10-09 17:24:40 -0700170 SCPF_choices += adder( "SCPF", "basic", true, "M", getResult )
171 SCPF_choices += adder( "SCPF", "extra_B", true, "M", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700172 closingHeader( "SCPF" )
173 addingHeader( "SR" )
Devin Lim431408d2018-03-23 17:51:31 -0700174 SR_choices += adder( "SR", "basic", true, "M", false )
Devin Lime89761a2018-03-16 17:52:57 -0700175 closingHeader( "SR" )
176 addingHeader( "USECASE" )
177 closingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700178}
179def tuesday( getDay, getResult ){
Devin Lime89761a2018-03-16 17:52:57 -0700180 addingHeader( "FUNC" )
Devin Lim61657e42017-10-09 17:24:40 -0700181 FUNC_choices += adder( "FUNC", "basic", getDay, "T", getResult )
182 FUNC_choices += adder( "FUNC", "extra_B", getDay, "T", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700183 closingHeader( "FUNC" )
184 addingHeader( "HA" )
Devin Lim61657e42017-10-09 17:24:40 -0700185 HA_choices += adder( "HA", "basic", getDay, "T", getResult )
186 HA_choices += adder( "HA", "extra_B", getDay, "T", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700187 closingHeader( "HA" )
188 addingHeader( "SCPF" )
Devin Lim61657e42017-10-09 17:24:40 -0700189 SCPF_choices += adder( "SCPF", "basic", getDay, "T", getResult )
190 SCPF_choices += adder( "SCPF", "extra_C", getDay, "T", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700191 closingHeader( "SCPF" )
192 addingHeader( "SR" )
Devin Lim431408d2018-03-23 17:51:31 -0700193 SR_choices += adder( "SR", "basic", getDay, "T", false )
Devin Lime89761a2018-03-16 17:52:57 -0700194 closingHeader( "SR" )
195 addingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700196 USECASE_choices += adder( "USECASE", "basic", getDay, "T", getResult )
197 USECASE_choices += adder( "USECASE", "extra_A", getDay, "T", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700198 closingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700199}
200def wednesday( getDay, getResult ){
Devin Lime89761a2018-03-16 17:52:57 -0700201 addingHeader( "FUNC" )
Devin Lim61657e42017-10-09 17:24:40 -0700202 FUNC_choices += adder( "FUNC", "basic", getDay, "W", getResult )
203 FUNC_choices += adder( "FUNC", "extra_A", getDay, "W", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700204 closingHeader( "FUNC" )
205 addingHeader( "HA" )
Devin Lim61657e42017-10-09 17:24:40 -0700206 HA_choices += adder( "HA", "basic", getDay, "W", getResult )
207 HA_choices += adder( "HA", "extra_A", getDay, "W", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700208 closingHeader( "HA" )
209 addingHeader( "SCPF" )
Devin Lim61657e42017-10-09 17:24:40 -0700210 SCPF_choices += adder( "SCPF", "basic", getDay, "W", getResult )
211 SCPF_choices += adder( "SCPF", "extra_A", getDay, "W", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700212 closingHeader( "SCPF" )
213 addingHeader( "SR" )
Devin Lim431408d2018-03-23 17:51:31 -0700214 SR_choices += adder( "SR", "basic", getDay, "W", false )
Devin Lime89761a2018-03-16 17:52:57 -0700215 closingHeader( "SR" )
216 addingHeader( "USECASE" )
217 closingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700218}
219def thursday( getDay, getResult ){
Devin Lime89761a2018-03-16 17:52:57 -0700220 addingHeader( "FUNC" )
Devin Lim61657e42017-10-09 17:24:40 -0700221 FUNC_choices += adder( "FUNC", "basic", getDay, "Th", getResult )
222 FUNC_choices += adder( "FUNC", "extra_B", getDay, "Th", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700223 closingHeader( "FUNC" )
224 addingHeader( "HA" )
Devin Lim61657e42017-10-09 17:24:40 -0700225 HA_choices += adder( "HA", "basic", getDay, "Th", getResult )
226 HA_choices += adder( "HA", "extra_B", getDay, "Th", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700227 closingHeader( "HA" )
228 addingHeader( "SCPF" )
Devin Lim61657e42017-10-09 17:24:40 -0700229 SCPF_choices += adder( "SCPF", "basic", getDay, "Th", getResult )
230 SCPF_choices += adder( "SCPF", "extra_B", getDay, "Th", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700231 closingHeader( "SCPF" )
232 addingHeader( "SR" )
Devin Lim431408d2018-03-23 17:51:31 -0700233 SR_choices += adder( "SR", "basic", getDay, "Th", false )
Devin Lime89761a2018-03-16 17:52:57 -0700234 closingHeader( "SR" )
235 addingHeader( "USECASE" )
236 closingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700237}
238def friday( getDay, getResult ){
Devin Lime89761a2018-03-16 17:52:57 -0700239 addingHeader( "FUNC" )
Devin Lim61657e42017-10-09 17:24:40 -0700240 FUNC_choices += adder( "FUNC", "basic", getDay, "F", getResult )
241 FUNC_choices += adder( "FUNC", "extra_A", getDay, "F", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700242 closingHeader( "FUNC" )
243 addingHeader( "HA" )
Devin Lim61657e42017-10-09 17:24:40 -0700244 HA_choices += adder( "HA", "basic", getDay, "F", getResult )
245 HA_choices += adder( "HA", "extra_A", getDay, "F", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700246 closingHeader( "HA" )
247 addingHeader( "SCPF" )
Devin Lim61657e42017-10-09 17:24:40 -0700248 SCPF_choices += adder( "SCPF", "basic", getDay, "F", getResult )
249 SCPF_choices += adder( "SCPF", "extra_A", getDay, "F", getResult )
250 SCPF_choices += adder( "SCPF", "extra_D", getDay, "F", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700251 closingHeader( "SCPF" )
252 addingHeader( "SR" )
Devin Lim431408d2018-03-23 17:51:31 -0700253 SR_choices += adder( "SR", "basic", getDay, "F", false )
Devin Limbe483072018-03-24 14:37:48 -0700254 SR_choices += adder( "SR", "extra_A", getDay, "F", false )
Devin Lime89761a2018-03-16 17:52:57 -0700255 closingHeader( "SR" )
256 addingHeader( "USECASE" )
257 closingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700258}
Devin Lime89761a2018-03-16 17:52:57 -0700259def saturday( getDay, getResult ){
260 addingHeader( "FUNC" )
261 FUNC_choices += adder( "FUNC", "basic", getDay, "Sa", getResult )
262 FUNC_choices += adder( "FUNC", "extra_A", getDay, "Sa", getResult )
263 FUNC_choices += adder( "FUNC", "extra_B", getDay, "Sa", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700264 closingHeader( "FUNC" )
265 addingHeader( "HA" )
266 HA_choices += adder( "HA", "basic", getDay, "Sa", getResult )
267 HA_choices += adder( "HA", "extra_A", getDay, "Sa", getResult )
268 HA_choices += adder( "HA", "extra_B", getDay, "Sa", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700269 closingHeader( "HA" )
270 addingHeader( "SCPF" )
271 SCPF_choices += adder( "SCPF", "basic", getDay, "Sa", getResult )
272 SCPF_choices += adder( "SCPF", "extra_A", getDay, "Sa", getResult )
273 SCPF_choices += adder( "SCPF", "extra_B", getDay, "Sa", getResult )
274 SCPF_choices += adder( "SCPF", "extra_C", getDay, "Sa", getResult )
275 SCPF_choices += adder( "SCPF", "extra_D", getDay, "Sa", getResult )
Devin Lime89761a2018-03-16 17:52:57 -0700276 closingHeader( "SCPF" )
277 addingHeader( "SR" )
Devin Lim431408d2018-03-23 17:51:31 -0700278 SR_choices += adder( "SR", "basic", getDay, "Sa", false )
Devin Limbe483072018-03-24 14:37:48 -0700279 SR_choices += adder( "SR", "extra_B", getDay, "Sa", false )
Devin Lime89761a2018-03-16 17:52:57 -0700280 closingHeader( "SR" )
281 addingHeader( "USECASE" )
282 USECASE_choices += adder( "USECASE", "basic", getDay, "Sa", getResult )
283 closingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700284}
Devin Lime89761a2018-03-16 17:52:57 -0700285def sunday( getDay, getResult ){
286 addingHeader( "FUNC" )
287 FUNC_choices += adder( "FUNC", "basic", getDay, "S", getResult )
288 FUNC_choices += adder( "FUNC", "extra_A", getDay, "S", getResult )
289 FUNC_choices += adder( "FUNC", "extra_B", getDay, "S", getResult )
290 closingHeader( "FUNC" )
291 addingHeader( "HA" )
292 HA_choices += adder( "HA", "basic", getDay, "S", getResult )
293 HA_choices += adder( "HA", "extra_A", getDay, "S", getResult )
294 HA_choices += adder( "HA", "extra_B", getDay, "S", getResult )
295 closingHeader( "HA" )
296 addingHeader( "SCPF" )
297 SCPF_choices += adder( "SCPF", "basic", getDay, "S", getResult )
298 SCPF_choices += adder( "SCPF", "extra_A", getDay, "S", getResult )
299 SCPF_choices += adder( "SCPF", "extra_B", getDay, "S", getResult )
300 SCPF_choices += adder( "SCPF", "extra_C", getDay, "S", getResult )
301 SCPF_choices += adder( "SCPF", "extra_D", getDay, "S", getResult )
302 closingHeader( "SCPF" )
303 addingHeader( "SR" )
Devin Lim431408d2018-03-23 17:51:31 -0700304 SR_choices += adder( "SR", "basic", getDay, "S", false )
Devin Lime89761a2018-03-16 17:52:57 -0700305 closingHeader( "SR" )
306 addingHeader( "USECASE" )
307 USECASE_choices += adder( "USECASE", "basic", getDay, "S", getResult )
308 closingHeader( "USECASE" )
Devin Lim61657e42017-10-09 17:24:40 -0700309}
310def adder( testCat, set, dayAdding, day, getResult ){
311 result = ""
Devin Lime89761a2018-03-16 17:52:57 -0700312 for( String test in AllTheTests[ testCat ].keySet() ){
Devin Lim61657e42017-10-09 17:24:40 -0700313 if( AllTheTests[ testCat ][ test ][ set ] ){
314 if( getResult )
315 result += test + ","
316 if( dayAdding )
317 dayAdder( testCat, test, day )
Devin Lime89761a2018-03-16 17:52:57 -0700318 makeHtmlColList( testCat, test )
Devin Lim61657e42017-10-09 17:24:40 -0700319 }
320 }
321 return result
322}
Devin Lime89761a2018-03-16 17:52:57 -0700323def initHtmlForWiki(){
324 wikiContents = '''
325 <table class="wrapped confluenceTable">
326 <colgroup>
327 <col />
328 <col />
329 <col />
330 <col />
331 <col />
332 <col />
333 </colgroup>
334 <tbody>
335 <tr>
336 <th colspan="1" class="confluenceTh">
337 <br />
338 </th>
339 <th class="confluenceTh"><p>Monday</p></th>
340 <th class="confluenceTh"><p>Tuesday</p></th>
341 <th class="confluenceTh"><p>Wednesday</p></th>
342 <th class="confluenceTh"><p>Thursday</p></th>
343 <th class="confluenceTh"><p>Friday</p></th>
344 <th class="confluenceTh"><p>Saturday</p></th>
345 <th class="confluenceTh"><p>Sunday</p></th>
346 </tr>'''
347 for( String test in testcases.keySet() ){
348 testcases[ test ][ 'wikiContent' ] = '''
349 <tr>
350 <th colspan="1" class="confluenceTh">''' + test + '''</th>'''
351 }
352}
353def addingHeader( testCategory ){
354 testcases[ testCategory ][ 'wikiContent' ] += '''
355 <td class="confluenceTd">
356 <ul>'''
357}
358def makeHtmlColList( testCategory, testName ){
359 testcases[ testCategory ][ 'wikiContent' ] += '''
360 <li>'''+ testName +'''</li>'''
361
362}
363def closingHeader( testCategory ){
364 testcases[ testCategory ][ 'wikiContent' ] += '''
365 </ul>
366 </td>'''
367}
368def closeHtmlForWiki(){
369 for( String test in testcases.keySet() ){
370 wikiContents += testcases[ test ][ 'wikiContent' ]
371 wikiContents += '''
372 </tr>'''
373 }
374 wikiContents += '''
375 </tbody>
376 </table>
Devin Limb6f92de2018-04-13 18:27:33 -0700377 <p><strong>Everyday</strong>, all SegmentRouting tests are built and run on every supported branch.</p>
Devin Lime89761a2018-03-16 17:52:57 -0700378 <p>On <strong>Weekdays</strong>, all the other tests are built and run on the master branch.</p>
379 <p>On <strong>Saturdays</strong>, all the other tests are built and run on the '''+ funcs.branchWithPrefix( previous_version ) +''' branch.</p>
380 <p>On <strong>Sundays</strong>, all the other tests are built and run on the '''+ funcs.branchWithPrefix( before_previous_version ) +''' branch.</p>'''
381}
382def postToWiki( contents ){
383 node( testMachine ){
384 workspace = "/var/jenkins/workspace/all-pipeline-trigger/"
385 filename = "jenkinsSchedule.txt"
386 writeFile file: workspace + filename, text: contents
387 funcs.publishToConfluence( "false", "true",
388 "Automated Test Schedule",
389 workspace + filename )
390 }
391}
Devin Lim61657e42017-10-09 17:24:40 -0700392def dayAdder( testCat, testName, dayOfWeek ){
393 AllTheTests[ testCat ][ testName ][ "day" ] += dayOfWeek + ","
Devin Lim41f087a2018-03-27 12:28:08 -0700394}