Use double quotes in HTML output to accommodate limited third-party tools

Issue #361 resolved
Robin James Kerrison
created an issue

The coverage.py HTML output wraps the values of attributes in single quotes, thusly:

<head>
    <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
    <title>Coverage report</title>
    <link rel='stylesheet' href='style.css' type='text/css'>

    <script type='text/javascript' src='jquery.min.js'></script>
    <script type='text/javascript' src='jquery.tablesorter.min.js'></script>
    <script type='text/javascript' src='jquery.hotkeys.js'></script>
    <script type='text/javascript' src='coverage_html.js'></script>
    <script type='text/javascript' charset='utf-8'>
        jQuery(document).ready(coverage.index_ready);
    </script>
</head>

It should be wrapping in double quotes, or at least there should be an easy way to configure using double quotes.

Current behaviour is an issue when trying to use coverage.py alongside CCNet, since the former outputs single quotes and the latter only searches for double quotes when resolving sources and anchors using its RetrieveBuildFile handler.

Comments (10)

  1. Robin James Kerrison reporter

    I'm running

    <tasks>
        <exec>
            <executable>C:\Python27\Scripts\coverage.exe</executable>
            <baseDirectory>F:\MyPythonSolution</baseDirectory>
            <buildArgs>run "F:\MyPythonSolution\tests.py"</buildArgs>
            <buildTimeoutSeconds>600</buildTimeoutSeconds>
        </exec>
        <exec>
            <executable>C:\Python27\Scripts\coverage.exe</executable>
            <baseDirectory>F:\MyPythonSolution</baseDirectory>
            <buildArgs>html --omit=*/tests/*,*runtests*,*__init__* -d "$[$CCNetArtifactDirectory]\$[$CCNetLabel]\coveragereport"</buildArgs>
            <buildTimeoutSeconds>600</buildTimeoutSeconds>
        </exec>
    </tasks>
    

    which outputs the html coverage report into a folder which is later read by CCNet's htmlReportPlugin:

    <htmlReportPlugin description="Coverage Report" actionName="myPythonCoverageReport" htmlFileName="coveragereport\index.html">
        <includedProjects>
            <projectName>MyPython Code Coverage</projectName>
        </includedProjects>
    </htmlReportPlugin>
    

    This question at StackOverflow describes the same CCNet issue.

  2. Log in to comment