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