Devin Lim | e1346f4 | 2018-05-15 15:41:36 -0700 | [diff] [blame] | 1 | #!groovy |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 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 | |
| 21 | // This is the Jenkins script for vm-pipeline-trigger or bm-pipeline-trigger |
| 22 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 23 | // set the functions of the dependencies. |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame] | 24 | funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' ) |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame] | 25 | triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/TriggerFuncs.groovy' ) |
| 26 | fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' ) |
Jeremy Ronquillo | 64eeeb1 | 2019-05-13 11:19:46 -0700 | [diff] [blame] | 27 | test_list = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' ) |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 28 | |
Jeremy Ronquillo | 4fd8244 | 2019-05-21 20:56:58 -0700 | [diff] [blame] | 29 | test_list.init() |
| 30 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 31 | // set the versions of the onos |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 32 | fileRelated.init() |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 33 | |
| 34 | // init trend graphs to be on VM. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 35 | funcs.initializeTrend( "VM" ); |
| 36 | triggerFuncs.init( funcs ) |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 37 | |
| 38 | // contents for page https://wiki.onosproject.org/display/ONOS/Automated+Test+Schedule |
| 39 | // which will demonstrates the list of the scheduled tests on the days. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 40 | wikiContents = "" |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 41 | |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 42 | all_testcases = [:] |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 43 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 44 | // read the parameters from the Jenkins |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 45 | manually_run = params.manual_run |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 46 | |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 47 | onos_tag = params.ONOSTag |
| 48 | isOldFlow = true |
| 49 | |
| 50 | // Set tests based on day of week |
| 51 | def now = funcs.getCurrentTime() |
| 52 | print now.toString() |
| 53 | today = now[ Calendar.DAY_OF_WEEK ] |
| 54 | |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 55 | dayMap = [ ( Calendar.MONDAY ) : "mon", |
| 56 | ( Calendar.TUESDAY ) : "tue", |
| 57 | ( Calendar.WEDNESDAY ) : "wed", |
| 58 | ( Calendar.THURSDAY ) : "thu", |
| 59 | ( Calendar.FRIDAY ) : "fri", |
| 60 | ( Calendar.SATURDAY ) : "sat", |
| 61 | ( Calendar.SUNDAY ) : "sun" ] |
| 62 | fullDayMap = [ ( Calendar.MONDAY ) : "Monday", |
| 63 | ( Calendar.TUESDAY ) : "Tuesday", |
| 64 | ( Calendar.WEDNESDAY ) : "Wednesday", |
| 65 | ( Calendar.THURSDAY ) : "Thursday", |
| 66 | ( Calendar.FRIDAY ) : "Friday", |
| 67 | ( Calendar.SATURDAY ) : "Saturday", |
| 68 | ( Calendar.SUNDAY ) : "Sunday" ] |
| 69 | |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 70 | if ( manually_run ){ |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 71 | onos_branches = params.branches.tokenize( "\n;, " ) |
| 72 | } else { |
| 73 | onos_branches = getBranchesFromDay( dayMap[ today ] ) |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 74 | } |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 75 | |
| 76 | // default FUNC,HA to be VM, SCPF,USECASE to be BM. |
| 77 | // SR will not be used in here. |
| 78 | testcases_template = [ |
| 79 | "FUNC": [ tests: "", nodeName: "VM", wikiContent: "" ], |
| 80 | "HA": [ tests: "", nodeName: "VM", wikiContent: "" ], |
| 81 | "SCPF": [ tests: "", nodeName: "BM", wikiContent: "" ], |
| 82 | "SR": [ tests: "", nodeName: "Fabric", wikiContent: "" ], |
| 83 | "SRHA": [ tests: "", nodeName: "Fabric", wikiContent: "" ], |
| 84 | "USECASE": [ tests: "", nodeName: "BM", wikiContent: "" ] |
| 85 | ] |
| 86 | |
| 87 | for ( String b in onos_branches ){ |
| 88 | all_testcases.put( b, testcases_template ) |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 89 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 90 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 91 | // list of the tests to be run will be saved in each choices. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 92 | day = "" |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 93 | |
| 94 | // init some paths for the files and directories. |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 95 | stat_graph_generator_file = fileRelated.histogramMultiple |
| 96 | pie_graph_generator_file = fileRelated.pieMultiple |
| 97 | graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-VM/" |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 98 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 99 | // get post result from the params for manually run. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 100 | post_result = params.PostResult |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 101 | |
| 102 | // if automatically run, it will remove the comma at the end after dividing the tests. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 103 | if ( manually_run ){ |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 104 | for ( String b in onos_branches ){ |
| 105 | all_testcases[ b ] = triggerFuncs.organize_tests( params.Tests, all_testcases[ b ] ) |
| 106 | } |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 107 | isOldFlow = params.isOldFlow |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 108 | println "Tests to be run manually:" |
| 109 | } else { |
| 110 | testDivider( today ) |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 111 | println "Defaulting to " + day + " tests:" |
| 112 | } |
| 113 | |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 114 | |
| 115 | for ( String b in onos_branches ){ |
| 116 | triggerFuncs.print_tests( all_testcases[ b ] ) |
| 117 | } |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 118 | |
| 119 | def runTest = [ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 120 | "VM": [ : ], |
| 121 | "BM": [ : ] |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 122 | ] |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 123 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 124 | def finalList = [ : ] |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 125 | |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 126 | finalList[ "VM" ] = [ : ] |
| 127 | finalList[ "BM" ] = [ : ] |
| 128 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 129 | // get the name of the job. |
Devin Lim | b91bf79 | 2018-05-10 15:09:52 -0700 | [diff] [blame] | 130 | jobName = env.JOB_NAME |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 131 | |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 132 | // set the test running function into the dictionary. |
| 133 | for ( String b in onos_branches ){ |
| 134 | for ( String test in all_testcases[ b ].keySet() ){ |
| 135 | if ( all_testcases[ b ][ test ][ "tests" ] != "" ){ |
| 136 | runTest[ all_testcases[ b ][ test ][ "nodeName" ] ][ test ] = triggerFuncs. |
| 137 | trigger_pipeline( b, all_testcases[ b ][ test ][ "tests" ], all_testcases[ b ][ test ][ "nodeName" ], test, |
| 138 | manually_run, onos_tag ) |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // first set the list of the functions to be run. |
| 143 | finalList[ "VM" ][ b ] = triggerFuncs.runTestSeq( runTest[ "VM" ] ) |
| 144 | finalList[ "BM" ][ b ] = triggerFuncs.runTestSeq( runTest[ "BM" ] ) |
| 145 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 146 | |
| 147 | // if first two character of the job name is vm, only call VM. |
| 148 | // else, only on BM |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 149 | |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 150 | if ( jobName.take( 2 ) == "vm" ){ |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 151 | parallel finalList[ "VM" ] |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 152 | } |
| 153 | else { |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 154 | parallel finalList[ "BM" ] |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 155 | } |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 156 | |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 157 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 158 | // If it is automated running, it will generate the stats graph on VM. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 159 | if ( !manually_run ){ |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 160 | for ( String b in onos_branches ){ |
| 161 | funcs.generateStatGraph( "TestStation-VMs", |
| 162 | funcs.branchWithPrefix( b ), |
| 163 | stat_graph_generator_file, |
| 164 | pie_graph_generator_file, |
| 165 | graph_saved_directory ) |
| 166 | } |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 167 | } |
| 168 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 169 | // function that will divide tests depends on which day it is. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 170 | def testDivider( today ){ |
Jeremy Ronquillo | 64eeeb1 | 2019-05-13 11:19:46 -0700 | [diff] [blame] | 171 | todayStr = today.toString() |
| 172 | |
Jeremy Ronquillo | 64eeeb1 | 2019-05-13 11:19:46 -0700 | [diff] [blame] | 173 | if ( today == Calendar.MONDAY ){ |
| 174 | initHtmlForWiki() |
| 175 | day = fullDayMap[ today ] |
| 176 | for ( key in dayMap.keySet() ){ |
| 177 | buildDay( dayMap[ key ], false ) |
| 178 | } |
| 179 | closeHtmlForWiki() |
| 180 | postToWiki( wikiContents ) |
| 181 | slackSend( color: '#FFD988', |
| 182 | message: "Tests to be run this weekdays : \n" + |
| 183 | triggerFuncs.printDaysForTest() ) |
| 184 | } else { |
| 185 | day = fullDayMap[ today ] |
| 186 | buildDay( dayMap[ today ], true ) |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 187 | } |
| 188 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 189 | |
Jeremy Ronquillo | 64eeeb1 | 2019-05-13 11:19:46 -0700 | [diff] [blame] | 190 | def buildDay( dayStr, getResult ){ |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 191 | for ( String b in onos_branches ){ |
| 192 | addingHeader( "FUNC", b ) |
| 193 | all_testcases[ b ][ "FUNC" ][ "tests" ] += adder( "FUNC", dayStr, getResult, b ) |
| 194 | closingHeader( "FUNC", b ) |
| 195 | addingHeader( "HA", b ) |
| 196 | all_testcases[ b ][ "HA" ][ "tests" ] += adder( "HA", dayStr, getResult, b ) |
| 197 | closingHeader( "HA", b ) |
| 198 | addingHeader( "SCPF", b ) |
| 199 | all_testcases[ b ][ "SCPF" ][ "tests" ] += adder( "SCPF", dayStr, getResult, b ) |
| 200 | closingHeader( "SCPF", b ) |
| 201 | addingHeader( "SR", b ) |
| 202 | all_testcases[ b ][ "SR" ][ "tests" ] += adder( "SR", dayStr, false, b ) |
| 203 | closingHeader( "SR", b ) |
| 204 | addingHeader( "SRHA", b ) |
| 205 | all_testcases[ b ][ "SRHA" ][ "tests" ] += adder( "SRHA", dayStr, false, b ) |
| 206 | closingHeader( "SRHA", b ) |
| 207 | addingHeader( "USECASE", b ) |
| 208 | all_testcases[ b ][ "USECASE" ][ "tests" ] += adder( "USECASE", dayStr, getResult, b ) |
| 209 | closingHeader( "USECASE", b ) |
| 210 | } |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 211 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 212 | |
| 213 | // adder that will return the list of the tests. |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 214 | def adder( category, day, getResult, branch ){ |
Jeremy Ronquillo | 64eeeb1 | 2019-05-13 11:19:46 -0700 | [diff] [blame] | 215 | // category : the category of the test which will be either FUNC,HA,SR... |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 216 | // day : the day you are trying to add (m,t,w,th... ) |
| 217 | // getResult : if want to get the list of the test to be run. False will return empty list. |
| 218 | // And once the list is empty, it will not be run. |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 219 | def result = "" |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 220 | selectedTests = test_list.getTestsFromCategory( category, test_list.getTestsFromDay( day, branch ) ) |
Jeremy Ronquillo | 64eeeb1 | 2019-05-13 11:19:46 -0700 | [diff] [blame] | 221 | |
| 222 | for ( String test in selectedTests.keySet() ){ |
| 223 | if ( getResult ){ |
| 224 | result += test + "," |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 225 | } |
Jeremy Ronquillo | 64eeeb1 | 2019-05-13 11:19:46 -0700 | [diff] [blame] | 226 | // make HTML columns for wiki page on schedule. |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 227 | makeHtmlColList( category, test, branch ) |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 228 | } |
| 229 | return result |
| 230 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 231 | |
| 232 | // Initial part of the wiki page. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 233 | def initHtmlForWiki(){ |
| 234 | wikiContents = ''' |
| 235 | <table class="wrapped confluenceTable"> |
| 236 | <colgroup> |
| 237 | <col /> |
| 238 | <col /> |
| 239 | <col /> |
| 240 | <col /> |
| 241 | <col /> |
| 242 | <col /> |
| 243 | </colgroup> |
| 244 | <tbody> |
| 245 | <tr> |
| 246 | <th colspan="1" class="confluenceTh"> |
| 247 | <br /> |
| 248 | </th> |
| 249 | <th class="confluenceTh"><p>Monday</p></th> |
| 250 | <th class="confluenceTh"><p>Tuesday</p></th> |
| 251 | <th class="confluenceTh"><p>Wednesday</p></th> |
| 252 | <th class="confluenceTh"><p>Thursday</p></th> |
| 253 | <th class="confluenceTh"><p>Friday</p></th> |
| 254 | <th class="confluenceTh"><p>Saturday</p></th> |
| 255 | <th class="confluenceTh"><p>Sunday</p></th> |
| 256 | </tr>''' |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 257 | for ( String b in onos_branches ){ |
| 258 | for ( String test in all_testcases[ b ].keySet() ){ |
| 259 | all_testcases[ b ][ test ][ 'wikiContent' ] = ''' |
| 260 | <tr> |
| 261 | <th colspan="1" class="confluenceTh">''' + test + '''</th>''' |
| 262 | } |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 263 | } |
| 264 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 265 | |
| 266 | // adding header functionality. |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 267 | def addingHeader( testCategory, branch ){ |
| 268 | all_testcases[ branch ][ testCategory ][ 'wikiContent' ] += ''' |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 269 | <td class="confluenceTd"> |
| 270 | <ul>''' |
| 271 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 272 | |
| 273 | // making column list for html |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 274 | def makeHtmlColList( testCategory, testName, branch ){ |
| 275 | all_testcases[ branch ][ testCategory ][ 'wikiContent' ] += ''' |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 276 | <li>''' + testName + '''</li>''' |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 277 | |
| 278 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 279 | |
| 280 | // closing the header for html |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 281 | def closingHeader( testCategory, branch ){ |
| 282 | all_testcases[ branch ][ testCategory ][ 'wikiContent' ] += ''' |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 283 | </ul> |
| 284 | </td>''' |
| 285 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 286 | |
| 287 | // close the html for the wiki page. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 288 | def closeHtmlForWiki(){ |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 289 | for ( String b in onos_branches ){ |
| 290 | for ( String test in all_testcases[ b ].keySet() ){ |
| 291 | wikiContents += all_testcases[ b ][ test ][ 'wikiContent' ] |
| 292 | wikiContents += ''' |
| 293 | </tr>''' |
| 294 | } |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 295 | } |
| 296 | wikiContents += ''' |
| 297 | </tbody> |
| 298 | </table> |
| 299 | <p><strong>Everyday</strong>, all SegmentRouting tests are built and run on every supported branch.</p> |
| 300 | <p>On <strong>Weekdays</strong>, all the other tests are built and run on the master branch.</p> |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 301 | <p>On <strong>Saturdays</strong>, all the other tests are built and run on the ''' + |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 302 | test_list.convertBranchCodeToBranch( "onos-2.x" ) + ''' branch.</p> |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 303 | <p>On <strong>Sundays</strong>, all the other tests are built and run on the ''' + |
Jeremy Ronquillo | a37920b | 2019-05-23 14:34:25 -0700 | [diff] [blame^] | 304 | test_list.convertBranchCodeToBranch( "onos-1.x" ) + ''' branch.</p>''' |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 305 | } |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 306 | |
| 307 | // post the result to wiki page using publish to confluence. |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 308 | def postToWiki( contents ){ |
Jon Hall | 6af749d | 2018-05-29 12:59:47 -0700 | [diff] [blame] | 309 | node( testMachine ) { |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 310 | workspace = fileRelated.jenkinsWorkspace + "all-pipeline-trigger/" |
Devin Lim | 2edfcec | 2018-05-09 17:16:21 -0700 | [diff] [blame] | 311 | filename = "jenkinsSchedule.txt" |
| 312 | writeFile file: workspace + filename, text: contents |
| 313 | funcs.publishToConfluence( "false", "true", |
| 314 | "Automated Test Schedule", |
| 315 | workspace + filename ) |
| 316 | } |
| 317 | } |