Jon Hall | 2ee92f8 | 2018-06-07 13:07:33 -0700 | [diff] [blame^] | 1 | #!groovy |
| 2 | // Copyright 2018 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 SRHA-pipeline-<branch> |
| 22 | |
| 23 | // read dependencies. |
| 24 | funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' ) |
| 25 | test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' ) |
| 26 | fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' ) |
| 27 | |
| 28 | // init configuration to be SR |
| 29 | fileRelated.init() |
| 30 | funcs.initialize( "SR" ) |
| 31 | |
| 32 | // Allow to run with --params-file argument |
| 33 | hasArgs = true |
| 34 | |
| 35 | // get the name of the Jenkins job. |
| 36 | jobName = env.JOB_NAME |
| 37 | |
| 38 | // SRHA has it's own test machine |
| 39 | // testmachine = "Fabrics" |
| 40 | |
| 41 | // read the TestON.property depends on which branch it is running. |
| 42 | // ( currently master on Fabric4, 1.13 on Fabric2 and 1.12 on Fabric3 ) |
| 43 | def prop = null |
| 44 | prop = funcs.getProperties() |
| 45 | SRHA = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "SRHA" ] |
| 46 | |
| 47 | // set the file paths and directory |
| 48 | graph_generator_file = fileRelated.trendIndividual |
| 49 | graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric" + "/" |
| 50 | |
| 51 | // get the list of the tests. |
| 52 | echo( "Testcases:" ) |
| 53 | def testsToRun = null |
| 54 | testsToRun = funcs.getTestsToRun( prop[ "Tests" ] ) |
| 55 | funcs.printTestToRun( testsToRun ) |
| 56 | |
| 57 | // save the functions to run test in the dictionary. |
| 58 | def tests = [ : ] |
| 59 | for ( String test : SRHA.keySet() ){ |
| 60 | toBeRun = testsToRun.contains( test ) |
| 61 | def stepName = ( toBeRun ? "" : "Not " ) + "Running $test" |
| 62 | tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, |
| 63 | SRHA, graph_generator_file, graph_saved_directory ) |
| 64 | } |
| 65 | |
| 66 | // get start time |
| 67 | start = funcs.getCurrentTime() |
| 68 | |
| 69 | // run the tests sequentially |
| 70 | for ( test in tests.keySet() ){ |
| 71 | tests[ test ].call() |
| 72 | } |
| 73 | //funcs.generateOverallGraph( prop, SR, graph_saved_directory ) |
| 74 | // send the notification of ending test after SRHA tests are done. |
| 75 | funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] ) |