blob: 088f8eaf13899745e5324e81ede10b866f2952ad [file] [log] [blame]
#!groovy
funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/TriggerFuncs.groovy' )
current_version = "master"
previous_version = "1.12"
before_previous_version = "1.11"
funcs.initializeTrend( "Fabric" );
funcs.initialize( "Fabric" )
triggerFuncs.init( funcs )
wikiContents = ""
testcases = [
"FUNC" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
"HA" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
"SCPF" : [ tests : "" , nodeName : "BM", wikiContent : "" ],
"SR" : [ tests : "", nodeName : [ "Fabric2", "Fabric3" ], wikiContent : "" ],
"USECASE" : [ tests : "" , nodeName : "BM", wikiContent : "" ]
]
Prefix_organizer = [
"FU" : "FUNC",
"HA" : "HA",
"PL" : "USECASE",
"SA" : "USECASE",
"SC" : "SCPF",
"SR" : "SR",
"US" : "USECASE",
"VP" : "USECASE"
]
manually_run = params.manual_run
onos_b = "master"
test_branch = ""
onos_tag = params.ONOSTag
isOldFlow = true
// Set tests based on day of week
def now = funcs.getCurrentTime()
print now.toString()
today = now[ Calendar.DAY_OF_WEEK ]
if ( manually_run ){
onos_b = params.ONOSVersion
}
AllTheTests = test_lists.getAllTheTests( onos_b )
day = ""
SCPF_choices = ""
USECASE_choices = ""
FUNC_choices = ""
HA_choices = ""
SR_choices = ""
stat_graph_generator_file = "testCategoryBuildStats.R"
pie_graph_generator_file = "testCategoryPiePassFail.R"
graph_saved_directory = "/var/jenkins/workspace/postjob-Fabric/"
post_result = params.PostResult
if( !manually_run ){
slackSend( channel:'testing', color:'#03CD9F',
message:":sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:\n"
+ "Starting tests on : " + now.toString()
+ "\n:sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles::sparkles:" )
SR_choices += adder( "SR", "basic", true )
if ( today == Calendar.FRIDAY ){
SR_choices += adder( "SR", "extra_A", true )
} else if( today == Calendar.SATURDAY ){
SR_choices += adder( "SR", "extra_B", true )
}
SR_choices = triggerFuncs.lastCommaRemover( SR_choices )
}
if ( manually_run ){
testcases = triggerFuncs.organize_tests( params.Tests, testcases )
isOldFlow = params.isOldFlow
println "Tests to be run manually : "
}else{
testcases[ "SR" ][ "tests" ] = SR_choices
println "Defaulting to " + day + " tests:"
}
triggerFuncs.print_tests( testcases )
def runTest = [
"VM" : [:],
"BM" : [:],
"Fabric2" : [:],
"Fabric3" : [:]
]
for( String test in testcases.keySet() ){
println test
if ( testcases[ test ][ "tests" ] != "" ){
runTest[ testcases[ test ][ "nodeName" ][ 0 ] ][ test ] = triggerFuncs.trigger_pipeline( current_version, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ][ 0 ], test, manually_run, onos_tag )
runTest[ testcases[ test ][ "nodeName" ][ 1 ] ][ test ] = triggerFuncs.trigger_pipeline( previous_version, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ][ 1 ], test, manually_run, onos_tag )
}
}
def finalList = [:]
finalList[ "Fabric2" ] = triggerFuncs.runTestSeq( runTest[ "Fabric2" ] )
finalList[ "Fabric3" ] = triggerFuncs.runTestSeq( runTest[ "Fabric3" ] )
parallel finalList
/*
if ( !manually_run ){
funcs.generateStatGraph( "TestStation-Fabric2s",
funcs.branchWithPrefix( "master" ),
AllTheTests,
stat_graph_generator_file,
pie_graph_generator_file,
graph_saved_directory )
funcs.generateStatGraph( "TestStation-Fabric3s",
funcs.branchWithPrefix( "1.12" ),
AllTheTests,
stat_graph_generator_file,
pie_graph_generator_file,
graph_saved_directory )
}*/
def adder( testCat, set, getResult ){
result = ""
for( String test in AllTheTests[ testCat ].keySet() ){
if( AllTheTests[ testCat ][ test ][ set ] ){
if( getResult )
result += test + ","
}
}
return result
}