#!groovy

funcs = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsCommonFuncs.groovy' )
test_lists = evaluate readTrusted( 'TestON/JenkinsFile/JenkinsTestONTests.groovy' )
triggerFuncs = evaluate readTrusted( 'TestON/JenkinsFile/TriggerFuncs.groovy' )

previous_version = "1.12"
before_previous_version = "1.11"
funcs.initializeTrend( "VM" );
triggerFuncs.init( funcs )
wikiContents = ""
testcases = [
    "FUNC" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
    "HA" : [ tests : "" , nodeName : "VM", wikiContent : "" ],
    "SCPF" : [ tests : "" , nodeName : "BM", wikiContent : "" ],
    "SR" : [ tests : "", nodeName : "Fabric", 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
} else {
    if ( today == Calendar.SATURDAY ){
        onos_b = previous_version
    } else if( today == Calendar.SUNDAY ){
        onos_b = before_previous_version
    }
}
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-VM/"

post_result = params.PostResult
if( !manually_run ){
    slackSend( 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:" )
    testDivider( today )
    FUNC_choices =  triggerFuncs.lastCommaRemover( FUNC_choices )
    HA_choices =  triggerFuncs.lastCommaRemover( HA_choices )
    SCPF_choices =  triggerFuncs.lastCommaRemover( SCPF_choices )
    USECASE_choices =  triggerFuncs.lastCommaRemover( USECASE_choices )
    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[ "SCPF" ][ "tests" ] = SCPF_choices
    testcases[ "USECASE" ][ "tests" ] = USECASE_choices
    testcases[ "FUNC" ][ "tests" ] = FUNC_choices
    testcases[ "HA" ][ "tests" ] = HA_choices
    testcases[ "SR" ][ "tests" ] = SR_choices
    println "Defaulting to " + day + " tests:"
}

triggerFuncs.print_tests( testcases )

def runTest = [
    "VM" : [:],
    "BM" : [:]
]
for( String test in testcases.keySet() ){
    println test
    if ( testcases[ test ][ "tests" ] != "" ){
        runTest[ testcases[ test ][ "nodeName" ] ][ test ] = triggerFuncs.trigger_pipeline( onos_b, testcases[ test ][ "tests" ], testcases[ test ][ "nodeName" ], test, manually_run, onos_tag )
    }
}
def finalList = [:]
finalList[ "VM" ] = triggerFuncs.runTestSeq( runTest[ "VM" ] )
finalList[ "BM" ] = triggerFuncs.runTestSeq( runTest[ "BM" ] )
parallel finalList
//finalList[ "BM" ].call()

if ( !manually_run ){
    funcs.generateStatGraph( funcs.branchWithPrefix( onos_b ),
                             AllTheTests,
                             stat_graph_generator_file,
                             pie_graph_generator_file,
                             graph_saved_directory )
}

def testDivider( today ){
    switch ( today ) {
        case Calendar.MONDAY:
            initHtmlForWiki()
            monday( true )
            tuesday( true, false )
            wednesday( true, false )
            thursday( true, false )
            friday( true, false )
            saturday( false, false )
            sunday( false, false )
            day = "Monday"
            closeHtmlForWiki()
            postToWiki( wikiContents )
            slackSend( color:'#FFD988', message:"Tests to be run this weekdays : \n" + triggerFuncs.printDaysForTest() )
            break
        case Calendar.TUESDAY:
            tuesday( false, true )
            day = "Tuesday"
            break
        case Calendar.WEDNESDAY:
            wednesday( false, true )
            day = "Wednesday"
            break
        case Calendar.THURSDAY:
            thursday( false, true )
            day = "Thursday"
            break
        case Calendar.FRIDAY:
            friday( false, true )
            day = "Friday"
            break
        case Calendar.SATURDAY:
            saturday( false, true )
            day = "Saturday"
            break
        case Calendar.SUNDAY:
            sunday( false , true )
            day = "Sunday"
            isOldFlow = false
            break
    }
}
def monday( getResult ){
    addingHeader( "FUNC" )
    FUNC_choices += adder( "FUNC", "basic", true, "M", getResult )
    FUNC_choices += adder( "FUNC", "new_Test", true, "M", getResult )
    FUNC_choices += adder( "FUNC", "extra_A", true, "M", getResult )
    closingHeader( "FUNC" )
    addingHeader( "HA" )
    HA_choices += adder( "HA", "basic", true, "M", getResult )
    HA_choices += adder( "HA", "extra_A", true, "M", getResult )
    //HA_choices += adder( "HA", "new_Test", true, "M", getResult )
    closingHeader( "HA" )
    addingHeader( "SCPF" )
    SCPF_choices += adder( "SCPF", "basic", true, "M", getResult )
    SCPF_choices += adder( "SCPF", "extra_B", true, "M", getResult )
    closingHeader( "SCPF" )
    addingHeader( "SR" )
    SR_choices += adder( "SR", "basic", true, "M", false )
    closingHeader( "SR" )
    addingHeader( "USECASE" )
    closingHeader( "USECASE" )
}
def tuesday( getDay, getResult ){
    addingHeader( "FUNC" )
    FUNC_choices += adder( "FUNC", "basic", getDay, "T", getResult )
    FUNC_choices += adder( "FUNC", "new_Test", getDay, "T", getResult )
    FUNC_choices += adder( "FUNC", "extra_B", getDay, "T", getResult )
    closingHeader( "FUNC" )
    addingHeader( "HA" )
    HA_choices += adder( "HA", "basic", getDay, "T", getResult )
    HA_choices += adder( "HA", "extra_B", getDay, "T", getResult )
    HA_choices += adder( "HA", "new_Test", getDay, "T", getResult )
    closingHeader( "HA" )
    addingHeader( "SCPF" )
    SCPF_choices += adder( "SCPF", "basic", getDay, "T", getResult )
    SCPF_choices += adder( "SCPF", "extra_C", getDay, "T", getResult )
    closingHeader( "SCPF" )
    addingHeader( "SR" )
    SR_choices += adder( "SR", "basic", getDay, "T", false )
    closingHeader( "SR" )
    addingHeader( "USECASE" )
    USECASE_choices += adder( "USECASE", "basic", getDay, "T", getResult )
    USECASE_choices += adder( "USECASE", "extra_A", getDay, "T", getResult )
    closingHeader( "USECASE" )
}
def wednesday( getDay, getResult ){
    addingHeader( "FUNC" )
    FUNC_choices += adder( "FUNC", "basic", getDay, "W", getResult )
    FUNC_choices += adder( "FUNC", "new_Test", getDay, "W", getResult )
    FUNC_choices += adder( "FUNC", "extra_A", getDay, "W", getResult )
    closingHeader( "FUNC" )
    addingHeader( "HA" )
    HA_choices += adder( "HA", "basic", getDay, "W", getResult )
    HA_choices += adder( "HA", "extra_A", getDay, "W", getResult )
    //HA_choices += adder( "HA", "new_Test", getDay, "W", getResult )
    closingHeader( "HA" )
    addingHeader( "SCPF" )
    SCPF_choices += adder( "SCPF", "basic", getDay, "W", getResult )
    SCPF_choices += adder( "SCPF", "extra_A", getDay, "W", getResult )
    SCPF_choices += adder( "SCPF", "new_Test", getDay, "W", getResult )
    closingHeader( "SCPF" )
    addingHeader( "SR" )
    SR_choices += adder( "SR", "basic", getDay, "W", false )
    closingHeader( "SR" )
    addingHeader( "USECASE" )
    closingHeader( "USECASE" )
}
def thursday( getDay, getResult ){
    addingHeader( "FUNC" )
    FUNC_choices += adder( "FUNC", "basic", getDay, "Th", getResult )
    FUNC_choices += adder( "FUNC", "new_Test", getDay, "Th", getResult )
    FUNC_choices += adder( "FUNC", "extra_B", getDay, "Th", getResult )
    closingHeader( "FUNC" )
    addingHeader( "HA" )
    HA_choices += adder( "HA", "basic", getDay, "Th", getResult )
    HA_choices += adder( "HA", "extra_B", getDay, "Th", getResult )
    HA_choices += adder( "HA", "new_Test", getDay, "Th", getResult )
    closingHeader( "HA" )
    addingHeader( "SCPF" )
    SCPF_choices += adder( "SCPF", "basic", getDay, "Th", getResult )
    SCPF_choices += adder( "SCPF", "extra_B", getDay, "Th", getResult )
    closingHeader( "SCPF" )
    addingHeader( "SR" )
    SR_choices += adder( "SR", "basic", getDay, "Th", false )
    closingHeader( "SR" )
    addingHeader( "USECASE" )
    closingHeader( "USECASE" )
}
def friday( getDay, getResult ){
    addingHeader( "FUNC" )
    FUNC_choices += adder( "FUNC", "basic", getDay, "F", getResult )
    FUNC_choices += adder( "FUNC", "new_Test", getDay, "F", getResult )
    FUNC_choices += adder( "FUNC", "extra_A", getDay, "F", getResult )
    closingHeader( "FUNC" )
    addingHeader( "HA" )
    HA_choices += adder( "HA", "basic", getDay, "F", getResult )
    HA_choices += adder( "HA", "extra_A", getDay, "F", getResult )
    //HA_choices += adder( "HA", "new_Test", getDay, "F", getResult )
    closingHeader( "HA" )
    addingHeader( "SCPF" )
    SCPF_choices += adder( "SCPF", "basic", getDay, "F", getResult )
    SCPF_choices += adder( "SCPF", "extra_A", getDay, "F", getResult )
    SCPF_choices += adder( "SCPF", "extra_D", getDay, "F", getResult )
    closingHeader( "SCPF" )
    addingHeader( "SR" )
    SR_choices += adder( "SR", "basic", getDay, "F", false )
    SR_choices += adder( "SR", "extra_A", getDay, "F", false )
    closingHeader( "SR" )
    addingHeader( "USECASE" )
    closingHeader( "USECASE" )
}
def saturday( getDay, getResult ){
    addingHeader( "FUNC" )
    FUNC_choices += adder( "FUNC", "basic", getDay, "Sa", getResult )
    FUNC_choices += adder( "FUNC", "extra_A", getDay, "Sa", getResult )
    FUNC_choices += adder( "FUNC", "extra_B", getDay, "Sa", getResult )
    FUNC_choices += adder( "FUNC", "new_Test", getDay, "Sa", getResult )
    closingHeader( "FUNC" )
    addingHeader( "HA" )
    HA_choices += adder( "HA", "basic", getDay, "Sa", getResult )
    HA_choices += adder( "HA", "extra_A", getDay, "Sa", getResult )
    HA_choices += adder( "HA", "extra_B", getDay, "Sa", getResult )
    HA_choices += adder( "HA", "new_Test", getDay, "Sa", getResult )
    closingHeader( "HA" )
    addingHeader( "SCPF" )
    SCPF_choices += adder( "SCPF", "basic", getDay, "Sa", getResult )
    SCPF_choices += adder( "SCPF", "extra_A", getDay, "Sa", getResult )
    SCPF_choices += adder( "SCPF", "extra_B", getDay, "Sa", getResult )
    SCPF_choices += adder( "SCPF", "extra_C", getDay, "Sa", getResult )
    SCPF_choices += adder( "SCPF", "extra_D", getDay, "Sa", getResult )
    SCPF_choices += adder( "SCPF", "new_Test", getDay, "Sa", getResult )
    closingHeader( "SCPF" )
    addingHeader( "SR" )
    SR_choices += adder( "SR", "basic", getDay, "Sa", false )
    SR_choices += adder( "SR", "extra_B", getDay, "Sa", false )
    closingHeader( "SR" )
    addingHeader( "USECASE" )
    USECASE_choices += adder( "USECASE", "basic", getDay, "Sa", getResult )
    closingHeader( "USECASE" )
}
def sunday( getDay, getResult ){
    addingHeader( "FUNC" )
    FUNC_choices += adder( "FUNC", "basic", getDay, "S", getResult )
    FUNC_choices += adder( "FUNC", "extra_A", getDay, "S", getResult )
    FUNC_choices += adder( "FUNC", "extra_B", getDay, "S", getResult )
    closingHeader( "FUNC" )
    addingHeader( "HA" )
    HA_choices += adder( "HA", "basic", getDay, "S", getResult )
    HA_choices += adder( "HA", "extra_A", getDay, "S", getResult )
    HA_choices += adder( "HA", "extra_B", getDay, "S", getResult )
    closingHeader( "HA" )
    addingHeader( "SCPF" )
    SCPF_choices += adder( "SCPF", "basic", getDay, "S", getResult )
    SCPF_choices += adder( "SCPF", "extra_A", getDay, "S", getResult )
    SCPF_choices += adder( "SCPF", "extra_B", getDay, "S", getResult )
    SCPF_choices += adder( "SCPF", "extra_C", getDay, "S", getResult )
    SCPF_choices += adder( "SCPF", "extra_D", getDay, "S", getResult )
    closingHeader( "SCPF" )
    addingHeader( "SR" )
    SR_choices += adder( "SR", "basic", getDay, "S", false )
    closingHeader( "SR" )
    addingHeader( "USECASE" )
    USECASE_choices += adder( "USECASE", "basic", getDay, "S", getResult )
    closingHeader( "USECASE" )
}
def adder( testCat, set, dayAdding, day, getResult ){
    result = ""
    for( String test in AllTheTests[ testCat ].keySet() ){
        if( AllTheTests[ testCat ][ test ][ set ] ){
            if( getResult )
                result += test + ","
            if( dayAdding )
                dayAdder( testCat, test, day )
            makeHtmlColList( testCat, test )
        }
    }
    return result
}
def initHtmlForWiki(){
    wikiContents = '''
    <table class="wrapped confluenceTable">
        <colgroup>
              <col />
              <col />
              <col />
              <col />
              <col />
              <col />
        </colgroup>
        <tbody>
            <tr>
                <th colspan="1" class="confluenceTh">
                    <br />
                </th>
                <th class="confluenceTh"><p>Monday</p></th>
                <th class="confluenceTh"><p>Tuesday</p></th>
                <th class="confluenceTh"><p>Wednesday</p></th>
                <th class="confluenceTh"><p>Thursday</p></th>
                <th class="confluenceTh"><p>Friday</p></th>
                <th class="confluenceTh"><p>Saturday</p></th>
                <th class="confluenceTh"><p>Sunday</p></th>
            </tr>'''
    for( String test in testcases.keySet() ){
        testcases[ test ][ 'wikiContent' ] = '''
            <tr>
                <th colspan="1" class="confluenceTh">''' + test + '''</th>'''
    }
}
def addingHeader( testCategory ){
    testcases[ testCategory ][ 'wikiContent' ] += '''
                <td class="confluenceTd">
                    <ul>'''
}
def makeHtmlColList( testCategory, testName ){
    testcases[ testCategory ][ 'wikiContent' ] += '''
                        <li>'''+ testName +'''</li>'''

}
def closingHeader( testCategory ){
    testcases[ testCategory ][ 'wikiContent' ] += '''
                    </ul>
                </td>'''
}
def closeHtmlForWiki(){
    for( String test in testcases.keySet() ){
        wikiContents += testcases[ test ][ 'wikiContent' ]
        wikiContents += '''
            </tr>'''
    }
    wikiContents += '''
        </tbody>
    </table>
    <p><strong>Everyday</strong>, all SegmentRouting tests are built and run on every branch.</p>
    <p>On <strong>Weekdays</strong>, all the other tests are built and run on the master branch.</p>
    <p>On <strong>Saturdays</strong>, all the other tests are built and run on the '''+ funcs.branchWithPrefix( previous_version ) +''' branch.</p>
    <p>On <strong>Sundays</strong>, all the other tests are built and run on the '''+ funcs.branchWithPrefix( before_previous_version ) +''' branch.</p>'''
}
def postToWiki( contents ){
    node( testMachine ){
        workspace = "/var/jenkins/workspace/all-pipeline-trigger/"
        filename = "jenkinsSchedule.txt"
        writeFile file: workspace + filename, text: contents
        funcs.publishToConfluence( "false", "true",
                                   "Automated Test Schedule",
                                   workspace + filename )
    }
}
def dayAdder( testCat, testName, dayOfWeek ){
    AllTheTests[ testCat ][ testName ][ "day" ] += dayOfWeek + ","
}
