blob: 5f039b5445b5bcb810880c97883a748f7f3ef84a [file] [log] [blame]
Devin Lim90803a82017-08-29 13:41:44 -07001#!groovy
Devin Limb734ea52018-05-14 14:13:05 -07002SCPFfuncs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/PerformanceFuncs.groovy' )
Devin Lim61643762017-12-07 15:55:38 -08003SCPFfuncs.init()
Devin Limb734ea52018-05-14 14:13:05 -07004funcs = evaluate readTrusted( 'TestON/JenkinsFile/dependencies/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 Limc49c3732018-04-10 18:57:17 -070015isOldFlow = prop[ "isOldFlow" ] == "true"
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 Limc49c3732018-04-10 18:57:17 -070031funcs.sendResultToSlack( start, prop["manualRun"], prop[ "WikiPrefix" ] )