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