blob: 03913b619bc1226083ba8bf9aa52d37e873f8004 [file] [log] [blame]
Devin Lim90803a82017-08-29 13:41:44 -07001#!groovy
Devin Lim81ab48b2018-02-09 14:24:57 -08002SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/PerformanceFuncs.groovy' )
Devin Lim61643762017-12-07 15:55:38 -08003SCPFfuncs.init()
Devin Lim81ab48b2018-02-09 14:24:57 -08004funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
Devin Lim61643762017-12-07 15:55:38 -08005funcs.initialize( "SCPF", SCPFfuncs );
Devin Lim90803a82017-08-29 13:41:44 -07006// This is a Jenkinsfile for a scripted pipeline for the SCPF tests
Devin Lim90803a82017-08-29 13:41:44 -07007def prop = null
Devin Lim61643762017-12-07 15:55:38 -08008prop = funcs.getProperties()
9
10echo( "Testcases:" )
11def testsToRun = null
12testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
13funcs.printTestToRun( testsToRun )
14
Devin Lim0e967162017-11-03 15:59:53 -070015isOldFlow = prop[ "isOldFlow" ]
Devin Lim61643762017-12-07 15:55:38 -080016SCPFfuncs.oldFlowRuleCheck( isOldFlow, prop[ "ONOSBranch" ] )
Devin Lim90803a82017-08-29 13:41:44 -070017def tests = [:]
Devin Lim61643762017-12-07 15:55:38 -080018for( String test : SCPFfuncs.SCPF.keySet() ){
Devin Lim90803a82017-08-29 13:41:44 -070019 toBeRun = testsToRun.contains( test )
20 def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
Devin Lim61643762017-12-07 15:55:38 -080021
22 pureTestName = test.replaceAll( "WithFlowObj", "" )
23 tests[ stepName ] = funcs.runTest( test, toBeRun, prop, pureTestName, false, SCPFfuncs.SCPF, "", "" )
Devin Lim90803a82017-08-29 13:41:44 -070024}
25
Devin Lim61643762017-12-07 15:55:38 -080026start = funcs.getCurrentTime()
Devin Lim90803a82017-08-29 13:41:44 -070027// run the tests
28for ( test in tests.keySet() ){
Devin Lim61643762017-12-07 15:55:38 -080029 tests[ test ].call()
Devin Lim90803a82017-08-29 13:41:44 -070030}
Devin Lim61643762017-12-07 15:55:38 -080031funcs.sendResultToSlack( start, prop["manualRun"], prop[ "WikiPrefix" ] )