Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 1 | #!groovy |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame^] | 2 | SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 3 | SCPFfuncs.init() |
Devin Lim | b734ea5 | 2018-05-14 14:13:05 -0700 | [diff] [blame^] | 4 | funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/JenkinsCommonFuncs.groovy' ) |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 5 | funcs.initialize( "SCPF", SCPFfuncs ); |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 6 | // This is a Jenkinsfile for a scripted pipeline for the SCPF tests |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 7 | def prop = null |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 8 | prop = funcs.getProperties() |
| 9 | |
| 10 | echo( "Testcases:" ) |
| 11 | def testsToRun = null |
| 12 | testsToRun = funcs.getTestsToRun( prop[ "Tests" ] ) |
| 13 | funcs.printTestToRun( testsToRun ) |
| 14 | |
Devin Lim | c49c373 | 2018-04-10 18:57:17 -0700 | [diff] [blame] | 15 | isOldFlow = prop[ "isOldFlow" ] == "true" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 16 | SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ] ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 17 | def tests = [:] |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 18 | for( String test : SCPFfuncs.SCPF.keySet() ){ |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 19 | toBeRun = testsToRun.contains( test ) |
| 20 | def stepName = ( toBeRun ? "" : "Not " ) + "Running $test" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 21 | |
| 22 | pureTestName = test.replaceAll( "WithFlowObj", "" ) |
| 23 | tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false, SCPFfuncs.SCPF, "", "" ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 24 | } |
| 25 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 26 | start = funcs.getCurrentTime() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 27 | // run the tests |
| 28 | for ( test in tests.keySet() ){ |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 29 | tests[ test ].call() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 30 | } |
Devin Lim | c49c373 | 2018-04-10 18:57:17 -0700 | [diff] [blame] | 31 | funcs.sendResultToSlack( start, prop["manualRun"], prop[ "WikiPrefix" ] ) |