#!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" + 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 )
    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 )
    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 + ","
}