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