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