blob: 34abfa90f048071f2d6330af97e0af2a91a59c39 [file] [log] [blame]
Devin Lim90803a82017-08-29 13:41:44 -07001#!groovy
Devin Lim81ab48b2018-02-09 14:24:57 -08002funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -08003test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
4
Devin Lim61643762017-12-07 15:55:38 -08005funcs.initialize( "USECASE" );
6// This is a Jenkinsfile for a scripted pipeline for the USECASE tests
Devin Lim90803a82017-08-29 13:41:44 -07007def prop = null
Devin Lim61643762017-12-07 15:55:38 -08008prop = funcs.getProperties()
Jeremy Ronquillo14ecc172018-03-05 09:57:17 -08009USECASE = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "USECASE" ]
10
Jeremy Ronquillo2d2649d2017-09-14 12:53:06 -070011graph_generator_file = "~/OnosSystemTest/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R"
Devin Lim61643762017-12-07 15:55:38 -080012graph_saved_directory = "/var/jenkins/workspace/postjob-BM/"
Devin Lim90803a82017-08-29 13:41:44 -070013
Devin Lim61643762017-12-07 15:55:38 -080014echo( "Testcases:" )
15def testsToRun = null
16testsToRun = funcs.getTestsToRun( prop[ "Tests" ] )
17funcs.printTestToRun( testsToRun )
Devin Lim90803a82017-08-29 13:41:44 -070018
19def tests = [:]
20for( String test : USECASE.keySet() ){
21 toBeRun = testsToRun.contains( test )
22 def stepName = ( toBeRun ? "" : "Not " ) + "Running $test"
Devin Lim61643762017-12-07 15:55:38 -080023 tests[ stepName ] = funcs.runTest( test, toBeRun, prop, test, false, USECASE, graph_generator_file, graph_saved_directory )
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" ] )
32funcs.generateOverallGraph( prop, USECASE, graph_saved_directory )