blob: 5ec7a91209cd6f9611fbf95dc5e76aeea88029bb [file] [log] [blame]
Devin Lim431408d2018-03-23 17:51:31 -07001#!groovy
2
Devin Limfc4f22c2018-03-23 18:18:27 -07003funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
4test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
Devin Lim431408d2018-03-23 17:51:31 -07005triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/TriggerFuncs.groovy' )
6
7previous_version = "1.12"
8before_previous_version = "1.11"
9funcs.initializeTrend( "Fabric" );
10funcs.initialize( "Fabric" )
11triggerFuncs.init( funcs )
12
13wikiContents = ""
14testcases = [
15 "FUNC" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
16 "HA" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
17 "SCPF" : [ tests : "" , nodeName : "BM", wikiContent : "" ],
18 "SR" : [ tests : "", nodeName : "Fabric", wikiContent : "" ],
19 "USECASE" : [ tests : "" , nodeName : "BM", wikiContent : "" ]
20]
21Prefix_organizer = [
22 "FU" : "FUNC",
23 "HA" : "HA",
24 "PL" : "USECASE",
25 "SA" : "USECASE",
26 "SC" : "SCPF",
27 "SR" : "SR",
28 "US" : "USECASE",
29 "VP" : "USECASE"
30]
31
32manually_run = params.manual_run
33onos_b = "master"
34test_branch = ""
35onos_tag = params.ONOSTag
36isOldFlow = true
37
38// Set tests based on day of week
39def now = funcs.getCurrentTime()
40print now.toString()
41today = now[ Calendar.DAY_OF_WEEK ]
42
43if ( manually_run ){
44 onos_b = params.ONOSVersion
45}
46AllTheTests = test_lists.getAllTheTests( onos_b )
47
48day = ""
49SCPF_choices = ""
50USECASE_choices = ""
51FUNC_choices = ""
52HA_choices = ""
53SR_choices = ""
54stat_graph_generator_file = "testCategoryBuildStats.R"
55pie_graph_generator_file = "testCategoryPiePassFail.R"
56graph_saved_directory = "/var/jenkins/workspace/postjob-Fabric/"
57
58post_result = params.PostResult
59if( !manually_run ){
60 slackSend( channel:'sr-failures', color:'#03CD9F',
61 message:":sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:\n"
62 + "Starting tests on : " + now.toString()
63 + "\n:sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:" )
64
65 SR_choices += adder( "SR", "basic", true )
66 SR_choices = triggerFuncs.lastCommaRemover( SR_choices )
67}
68if ( manually_run ){
69 testcases = triggerFuncs.organize_tests( params.Tests, testcases )
70
71 isOldFlow = params.isOldFlow
72 println "Tests to be run manually : "
73}else{
74 testcases[ "SR" ][ "tests" ] = SR_choices
75 println "Defaulting to " + day + " tests:"
76}
77
78triggerFuncs.print_tests( testcases )
79
80def runTest = [
81 "VM" : [:],
82 "BM" : [:],
83 "Fabric" : [:]
84]
85for( String test in testcases.keySet() ){
86 println test
87 if ( testcases[ test ][ "tests" ] != "" ){
88 runTest[ testcases[ test ][ "nodeName" ] ][ test ] = triggerFuncs.trigger_pipeline( onos_b, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ], test, manually_run, onos_tag )
89 }
90}
91def finalList = [:]
92finalList[ "Fabric" ] = triggerFuncs.runTestSeq( runTest[ "Fabric" ] )
93parallel finalList
94/*
95if ( !manually_run ){
96 funcs.generateStatGraph( funcs.branchWithPrefix( onos_b ),
97 AllTheTests,
98 stat_graph_generator_file,
99 pie_graph_generator_file,
100 graph_saved_directory )
101}*/
102def adder( testCat, set, getResult ){
103 result = ""
104 for( String test in AllTheTests[ testCat ].keySet() ){
105 if( AllTheTests[ testCat ][ test ][ set ] ){
106 if( getResult )
107 result += test + ","
108 }
109 }
110 return result
111}