function showSuiteData()

in ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js [650:822]


function showSuiteData(suite, settings, prNum) {
    var moreInfoTxt = "";

    if (isDefinedAndFilled(suite.userCommits) && suite.userCommits !== "") {
        moreInfoTxt += "Last commits from: " + suite.userCommits + " <br>";
    }

    moreInfoTxt += "Duration: " + suite.durationPrintable + " " +
        "(Net Time: " + suite.durationNetTimePrintable + "," +
        " Tests: " + suite.testsDurationPrintable + "," +
        " Src. Update: " + suite.sourceUpdateDurationPrintable + "," +
        " Artifacts Publishing: " + suite.artifcactPublishingDurationPrintable + "," +
        " Dependecies Resolving: " + suite.dependeciesResolvingDurationPrintable + "," +
        " Timeouts: " + suite.lostInTimeouts + ")<br>";


    if(isDefinedAndFilled(suite.totalTests))
        moreInfoTxt += " <span title='Not muted and not ignored tests'>Total tests: " + suite.totalTests + "</span>";

    if(isDefinedAndFilled(suite.trustedTests))
        moreInfoTxt += " <span title='Tests which not filtered out because of flakyness'>Trusted tests: " + suite.trustedTests + "</span>";

    moreInfoTxt += "<br>";

    var res = "<tr class='suiteBlock'><td colspan='4' style='width: 100%'>" +
              "<table style='width: 100%' border='0px'>";

    res += "<tr bgcolor='#FAFAFF'><td align='right' valign='top' width='10%' colspan='2'>";

    var failRateText = "";
    if (isDefinedAndFilled(suite.failures) && isDefinedAndFilled(suite.runs) && isDefinedAndFilled(suite.failureRate)) {
        failRateText += "(fail rate " + suite.failureRate + "%)";

        moreInfoTxt += "Recent fails : "+ suite.failureRate +"% [" + suite.failures + " fails / " + suite.runs + " runs]; <br> " ;

        if(isDefinedAndFilled(suite.criticalFails) && isDefinedAndFilled(suite.criticalFails.failures)) {
            moreInfoTxt += "Critical recent fails: "+ suite.criticalFails.failureRate + "% [" + suite.criticalFails.failures + " fails / " + suite.criticalFails.runs + " runs]; <br> " ;
        }
    }

    if(isDefinedAndFilled(suite.blockerComment) && suite.blockerComment!=="") {
        res += "<span title='"+ suite.blockerComment +"'> &#x1f6ab;</span> "
    }

    if(isDefinedAndFilled(suite.problemRef)) {
        res += "<span title='"+ suite.problemRef.name +"'>&#128030;</span> "
    }

    var color;

    if(isDefinedAndFilled(suite.success) && suite.success===true) {
        color = 'green';
    } else {
        color = failureRateToColor(suite.failureRate);
    }

    if (isDefinedAndFilled(suite.latestRuns)) {
        res += drawLatestRuns(suite.latestRuns) + " ";
    }

    res +="</td><td>";
    res += "<span style='border-color: " + color + "; width:6px; height:6px; display: inline-block; border-width: 4px; color: black; border-style: solid;' title='" + failRateText + "'></span> ";

    res += "<a href='" + suite.webToHist + "'>" + suite.name + "</a> " +
        "[ " + "<a href='" + suite.webToBuild + "' title=''> " +
        "tests " + suite.failedTests + " " + suite.result;

    if (isDefinedAndFilled(suite.warnOnly) && suite.warnOnly.length > 0) {
        res += " warn " + suite.warnOnly.length;
    }

    res += "</a> ]";

    if(isDefinedAndFilled(suite.tags)) {
        for (let i = 0; i < suite.tags.length; i++) {
            const tag = suite.tags[i];
            res += " <span class='buildTag'>" + tag + "</span>" ;
        }
    }

    if (isDefinedAndFilled(suite.runningBuildCount) && suite.runningBuildCount !== 0) {
        res += " <img src='https://image.flaticon.com/icons/png/128/2/2745.png' width=12px height=12px> ";
        res += " " + suite.runningBuildCount + " running";
    }
    if (isDefinedAndFilled(suite.queuedBuildCount) && suite.queuedBuildCount !== 0) {
        res += " <img src='https://d30y9cdsu7xlg0.cloudfront.net/png/273613-200.png' width=12px height=12px> ";
        res += "" + suite.queuedBuildCount + " queued";
    }

    var mInfo = "";
    if (isDefinedAndFilled(suite.serverId) && isDefinedAndFilled(suite.suiteId) && isDefinedAndFilled(suite.branchName)) {
        mInfo += " Trigger build: ";
        mInfo += "<a href='javascript:void(0);' ";
        mInfo += " onClick='triggerBuilds(\"" + suite.serverId + "\", null, \"" +
            suite.suiteId + "\", \"" + suite.branchName + "\", false, false, null, \"" + prNum + "\", null, false)' ";
        mInfo += " title='trigger build' >queue</a> ";

        mInfo += "<a href='javascript:void(0);' ";
        mInfo += " onClick='triggerBuilds(\"" + suite.serverId + "\", null, \"" +
            suite.suiteId + "\", \"" + suite.branchName + "\", true, false, null, \"" + prNum + "\", null, false)' ";
        mInfo += " title='trigger build at top of queue'>top</a><br>";
    }

    mInfo += moreInfoTxt;

    if (isDefinedAndFilled(suite.topLongRunning) && suite.topLongRunning.length > 0) {
        mInfo += "Top long running:<br>";

        mInfo += "<table>";
        for (var j = 0; j < suite.topLongRunning.length; j++) {
            mInfo += showTestFailData(suite.topLongRunning[j], false, settings);
        }
        mInfo += "</table>";
    }

    if (isDefinedAndFilled(suite.warnOnly) && suite.warnOnly.length > 0) {
        mInfo += "Warn Only:<br>";
        mInfo += "<table>";
        for (var k = 0; k < suite.warnOnly.length; k++) {
            mInfo += showTestFailData(suite.warnOnly[k], false, settings);
        }
        mInfo += "</table>";
    }

    if (isDefinedAndFilled(suite.logConsumers) && suite.logConsumers.length > 0) {
        mInfo += "Top Log Consumers:<br>";
        mInfo += "<table>";
        for (var l = 0; l < suite.logConsumers.length; l++) {
            mInfo += showTestFailData(suite.logConsumers[l], false, settings);
        }
        mInfo += "</table>";
    }

    if(!isDefinedAndFilled(findGetParameter("reportMode"))) {
        res += "<span class='container'>";
        res += " <a href='javascript:void(0);' class='header'>" + more + "</a>";
        res += "<div class='content'>" + mInfo + "</div></span>";
    }

    res += "</td>";

    res += "<td width='25%'>"; //fail rate
    if(isDefinedAndFilled(suite.hasCriticalProblem) && suite.hasCriticalProblem
        && isDefinedAndFilled(suite.criticalFails) && isDefinedAndFilled(suite.criticalFails.failures)) {
        res += "<a href='" + suite.webToHistBaseBranch + "'>";
        res += "Critical F.R.: "+ suite.criticalFails.failureRate + "% </a> " ;
    } else {
        res+="&nbsp;";
    }
    res += "</td>"; //fail rate
    res += " </tr>";

    for (var i = 0; i < suite.testFailures.length; i++) {
        var testFailure = suite.testFailures[i];

        res += showTestFailData(testFailure, true, settings);
    }

    if (isDefinedAndFilled(suite.webUrlThreadDump)) {
        res += "<tr><td colspan='2'></td><td>&nbsp; &nbsp; <a href='" + suite.webUrlThreadDump + "'>";
        res += "<img src='https://cdn2.iconfinder.com/data/icons/metro-uinvert-dock/256/Services.png' width=12px height=12px> ";
        res += "Thread Dump</a>";
        res += "<td>&nbsp;</td>";
        res += "</td></tr>";
    }


    res += "<tr><td>&nbsp;</td><td width='12px'>&nbsp;</td><td colspan='2'></td></tr>";

    res += "</tr></table>"

    return res;
}