Devin Lim | d1fb8e9 | 2018-02-28 16:29:33 -0800 | [diff] [blame] | 1 | #!groovy |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame] | 2 | funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' ) |
| 3 | test_lists = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsTestONTests.groovy' ) |
| 4 | fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsPathAndFiles.groovy' ) |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 5 | |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 6 | fileRelated.init() |
Devin Lim | d1fb8e9 | 2018-02-28 16:29:33 -0800 | [diff] [blame] | 7 | funcs.initialize( "SR" ); |
Devin Lim | 35df4e6 | 2018-04-06 17:58:58 -0700 | [diff] [blame] | 8 | jobName = env.JOB_NAME |
Devin Lim | c4054d5 | 2018-04-13 18:58:33 -0700 | [diff] [blame] | 9 | funcs.additionalInitForSR( jobName ) |
Devin Lim | d1fb8e9 | 2018-02-28 16:29:33 -0800 | [diff] [blame] | 10 | // This is a Jenkinsfile for a scripted pipeline for the SR tests |
| 11 | def prop = null |
| 12 | prop = funcs.getProperties() |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 13 | SR = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "SR" ] |
| 14 | |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame] | 15 | graph_generator_file = fileRelated.trendIndividual |
| 16 | graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-Fabric" + funcs.fabricOn( prop[ "ONOSBranch" ] ) + "/" |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 17 | |
Devin Lim | d1fb8e9 | 2018-02-28 16:29:33 -0800 | [diff] [blame] | 18 | echo( "Testcases:" ) |
| 19 | def testsToRun = null |
| 20 | testsToRun = funcs.getTestsToRun( prop[ "Tests" ] ) |
| 21 | funcs.printTestToRun( testsToRun ) |
| 22 | |
| 23 | def tests = [:] |
| 24 | for( String test : SR.keySet() ){ |
| 25 | toBeRun = testsToRun.contains( test ) |
| 26 | def stepName = ( toBeRun ? "" : "Not " ) + "Running $test" |
| 27 | tests[stepName] = funcs.runTest( test, toBeRun, prop, test, false, SR, graph_generator_file, graph_saved_directory ) |
| 28 | } |
| 29 | |
| 30 | start = funcs.getCurrentTime() |
| 31 | // run the tests |
| 32 | for ( test in tests.keySet() ){ |
| 33 | tests[ test ].call() |
| 34 | } |
| 35 | //funcs.generateOverallGraph( prop, SR, graph_saved_directory ) |
Devin Lim | c4054d5 | 2018-04-13 18:58:33 -0700 | [diff] [blame] | 36 | funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] ) |