Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 1 | #!groovy |
Devin Lim | 81ab48b | 2018-02-09 14:24:57 -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' ) |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame^] | 4 | fileRelated = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsPathAndFiles.groovy' ) |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 5 | |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame^] | 6 | fileRelated.init() |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 7 | funcs.initialize( "USECASE" ); |
| 8 | // This is a Jenkinsfile for a scripted pipeline for the USECASE tests |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 9 | def prop = null |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 10 | prop = funcs.getProperties() |
Jeremy Ronquillo | 14ecc17 | 2018-03-05 09:57:17 -0800 | [diff] [blame] | 11 | USECASE = test_lists.getAllTheTests( prop[ "WikiPrefix" ] )[ "USECASE" ] |
| 12 | |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame^] | 13 | graph_generator_file = fileRelated.trendIndividual |
| 14 | graph_saved_directory = fileRelated.jenkinsWorkspace + "postjob-BM/" |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 15 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 16 | echo( "Testcases:" ) |
| 17 | def testsToRun = null |
| 18 | testsToRun = funcs.getTestsToRun( prop[ "Tests" ] ) |
| 19 | funcs.printTestToRun( testsToRun ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 20 | |
| 21 | def tests = [:] |
| 22 | for( String test : USECASE.keySet() ){ |
| 23 | toBeRun = testsToRun.contains( test ) |
| 24 | def stepName = ( toBeRun ? "" : "Not " ) + "Running $test" |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 25 | tests[ stepName ] = funcs.runTest( test, toBeRun, prop, test, false, USECASE, graph_generator_file, graph_saved_directory ) |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 26 | } |
| 27 | |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 28 | start = funcs.getCurrentTime() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 29 | // run the tests |
| 30 | for ( test in tests.keySet() ){ |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 31 | tests[ test ].call() |
Devin Lim | 90803a8 | 2017-08-29 13:41:44 -0700 | [diff] [blame] | 32 | } |
Devin Lim | 6164376 | 2017-12-07 15:55:38 -0800 | [diff] [blame] | 33 | funcs.sendResultToSlack( start, prop[ "manualRun" ], prop[ "WikiPrefix" ] ) |
Devin Lim | fe9a4cb | 2018-05-11 17:06:21 -0700 | [diff] [blame^] | 34 | funcs.generateOverallGraph( prop, USECASE, graph_saved_directory ) |