Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 1 | // Copyright 2017 Open Networking Foundation (ONF) |
| 2 | // |
| 3 | // Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 4 | // the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 5 | // or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 6 | // |
| 7 | // TestON is free software: you can redistribute it and/or modify |
| 8 | // it under the terms of the GNU General Public License as published by |
| 9 | // the Free Software Foundation, either version 2 of the License, or |
| 10 | // (at your option) any later version. |
| 11 | // |
| 12 | // TestON is distributed in the hope that it will be useful, |
| 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | // GNU General Public License for more details. |
| 16 | // |
| 17 | // You should have received a copy of the GNU General Public License |
| 18 | // along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 19 | |
| 20 | // This is the Jenkins script for manual-graph-generator-trend |
| 21 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 22 | #!groovy |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 23 | |
| 24 | // read the dependency functions |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame] | 25 | funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' ) |
| 26 | fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' ) |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 27 | |
| 28 | fileRelated.init() |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 29 | |
| 30 | // read the node cluster ( VM or BM or Fabrics ) from the Jenkins job. |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 31 | nodeCluster = params.NodeCluster |
| 32 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 33 | funcs.initializeTrend( nodeCluster ); |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 34 | |
| 35 | // do additional check for Fabric since it will be different depends on which branch it is running on. |
Devin Lim | 981f80b | 2018-04-09 11:25:59 -0700 | [diff] [blame] | 36 | if( nodeCluster == "Fabric" ) |
| 37 | funcs.additionalInitForSR( params.ONOSbranch ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 38 | def prop = null |
| 39 | prop = funcs.getProperties() |
| 40 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 41 | // get the list of the tests from the parameters. |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 42 | def Tests = params.Test |
| 43 | prop[ "ONOSBranch" ] = params.ONOSbranch |
| 44 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 45 | // set some of the paths of the file and directory |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 46 | graph_generator_file = fileRelated.trendIndividual |
| 47 | graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-" + nodeCluster + ( nodeCluster == "Fabric" ? funcs.fabricOn( prop[ "ONOSBranch" ] ) : "" ) + "/" |
Devin Lim | 86e4053 | 2018-04-06 12:44:06 -0700 | [diff] [blame] | 48 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 49 | def testsToRun = null |
| 50 | testsToRun = funcs.getTestsToRun( Tests ) |
| 51 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 52 | // set functions into the dictionary. |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 53 | def tests = [:] |
| 54 | for( String test : testsToRun ){ |
| 55 | println test |
| 56 | tests[ test ] = funcs.runTest( test, true, prop, test, true, [], graph_generator_file, graph_saved_directory ) |
| 57 | } |
| 58 | |
Devin Lim | f517519 | 2018-05-14 19:13:22 -0700 | [diff] [blame] | 59 | parallel tests |
| 60 | //for ( test in tests.keySet() ){ |
| 61 | // tests[ test ].call() |
| 62 | //} |