Merge pull request #87191 from edolstra/no-nested-logs

testing{-python}.nix: Remove log pretty-printing cruft

authored by Eelco Dolstra and committed by GitHub 10d74709 0d3871cb

+4 -324
-135
nixos/lib/test-driver/log2html.xsl
··· 1 - <?xml version="1.0"?> 2 - 3 - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 4 - 5 - <xsl:output method='html' encoding="UTF-8" 6 - doctype-public="-//W3C//DTD HTML 4.01//EN" 7 - doctype-system="http://www.w3.org/TR/html4/strict.dtd" /> 8 - 9 - <xsl:template match="logfile"> 10 - <html> 11 - <head> 12 - <script type="text/javascript" src="jquery.min.js"></script> 13 - <script type="text/javascript" src="jquery-ui.min.js"></script> 14 - <script type="text/javascript" src="treebits.js" /> 15 - <link rel="stylesheet" href="logfile.css" type="text/css" /> 16 - <title>Log File</title> 17 - </head> 18 - <body> 19 - <h1>VM build log</h1> 20 - <p> 21 - <a href="javascript:" class="logTreeExpandAll">Expand all</a> | 22 - <a href="javascript:" class="logTreeCollapseAll">Collapse all</a> 23 - </p> 24 - <ul class='toplevel'> 25 - <xsl:for-each select='line|nest'> 26 - <li> 27 - <xsl:apply-templates select='.'/> 28 - </li> 29 - </xsl:for-each> 30 - </ul> 31 - 32 - <xsl:if test=".//*[@image]"> 33 - <h1>Screenshots</h1> 34 - <ul class="vmScreenshots"> 35 - <xsl:for-each select='.//*[@image]'> 36 - <li><a href="{@image}"><xsl:value-of select="@image" /></a></li> 37 - </xsl:for-each> 38 - </ul> 39 - </xsl:if> 40 - 41 - </body> 42 - </html> 43 - </xsl:template> 44 - 45 - 46 - <xsl:template match="nest"> 47 - 48 - <!-- The tree should be collapsed by default if all children are 49 - unimportant or if the header is unimportant. --> 50 - <xsl:variable name="collapsed" select="not(./head[@expanded]) and count(.//*[@error]) = 0"/> 51 - 52 - <xsl:variable name="style"><xsl:if test="$collapsed">display: none;</xsl:if></xsl:variable> 53 - 54 - <xsl:if test="line|nest"> 55 - <a href="javascript:" class="logTreeToggle"> 56 - <xsl:choose> 57 - <xsl:when test="$collapsed"><xsl:text>+</xsl:text></xsl:when> 58 - <xsl:otherwise><xsl:text>-</xsl:text></xsl:otherwise> 59 - </xsl:choose> 60 - </a> 61 - <xsl:text> </xsl:text> 62 - </xsl:if> 63 - 64 - <xsl:apply-templates select='head'/> 65 - 66 - <!-- Be careful to only generate <ul>s if there are <li>s, otherwise it’s malformed. --> 67 - <xsl:if test="line|nest"> 68 - 69 - <ul class='nesting' style="{$style}"> 70 - <xsl:for-each select='line|nest'> 71 - 72 - <!-- Is this the last line? If so, mark it as such so that it 73 - can be rendered differently. --> 74 - <xsl:variable name="class"><xsl:choose><xsl:when test="position() != last()">line</xsl:when><xsl:otherwise>lastline</xsl:otherwise></xsl:choose></xsl:variable> 75 - 76 - <li class='{$class}'> 77 - <span class='lineconn' /> 78 - <span class='linebody'> 79 - <xsl:apply-templates select='.'/> 80 - </span> 81 - </li> 82 - </xsl:for-each> 83 - </ul> 84 - </xsl:if> 85 - 86 - </xsl:template> 87 - 88 - 89 - <xsl:template match="head|line"> 90 - <code> 91 - <xsl:if test="@error"> 92 - <xsl:attribute name="class">errorLine</xsl:attribute> 93 - </xsl:if> 94 - <xsl:if test="@warning"> 95 - <xsl:attribute name="class">warningLine</xsl:attribute> 96 - </xsl:if> 97 - <xsl:if test="@priority = 3"> 98 - <xsl:attribute name="class">prio3</xsl:attribute> 99 - </xsl:if> 100 - 101 - <xsl:if test="@type = 'serial'"> 102 - <xsl:attribute name="class">serial</xsl:attribute> 103 - </xsl:if> 104 - 105 - <xsl:if test="@machine"> 106 - <xsl:choose> 107 - <xsl:when test="@type = 'serial'"> 108 - <span class="machine"><xsl:value-of select="@machine"/># </span> 109 - </xsl:when> 110 - <xsl:otherwise> 111 - <span class="machine"><xsl:value-of select="@machine"/>: </span> 112 - </xsl:otherwise> 113 - </xsl:choose> 114 - </xsl:if> 115 - 116 - <xsl:choose> 117 - <xsl:when test="@image"> 118 - <a href="{@image}"><xsl:apply-templates/></a> 119 - </xsl:when> 120 - <xsl:otherwise> 121 - <xsl:apply-templates/> 122 - </xsl:otherwise> 123 - </xsl:choose> 124 - </code> 125 - </xsl:template> 126 - 127 - 128 - <xsl:template match="storeref"> 129 - <em class='storeref'> 130 - <span class='popup'><xsl:apply-templates/></span> 131 - <span class='elided'>/...</span><xsl:apply-templates select='name'/><xsl:apply-templates select='path'/> 132 - </em> 133 - </xsl:template> 134 - 135 - </xsl:stylesheet>
-129
nixos/lib/test-driver/logfile.css
··· 1 - body { 2 - font-family: sans-serif; 3 - background: white; 4 - } 5 - 6 - h1 7 - { 8 - color: #005aa0; 9 - font-size: 180%; 10 - } 11 - 12 - a { 13 - text-decoration: none; 14 - } 15 - 16 - 17 - ul.nesting, ul.toplevel { 18 - padding: 0; 19 - margin: 0; 20 - } 21 - 22 - ul.toplevel { 23 - list-style-type: none; 24 - } 25 - 26 - .line, .head { 27 - padding-top: 0em; 28 - } 29 - 30 - ul.nesting li.line, ul.nesting li.lastline { 31 - position: relative; 32 - list-style-type: none; 33 - } 34 - 35 - ul.nesting li.line { 36 - padding-left: 2.0em; 37 - } 38 - 39 - ul.nesting li.lastline { 40 - padding-left: 2.1em; /* for the 0.1em border-left in .lastline > .lineconn */ 41 - } 42 - 43 - li.line { 44 - border-left: 0.1em solid #6185a0; 45 - } 46 - 47 - li.line > span.lineconn, li.lastline > span.lineconn { 48 - position: absolute; 49 - height: 0.65em; 50 - left: 0em; 51 - width: 1.5em; 52 - border-bottom: 0.1em solid #6185a0; 53 - } 54 - 55 - li.lastline > span.lineconn { 56 - border-left: 0.1em solid #6185a0; 57 - } 58 - 59 - 60 - em.storeref { 61 - color: #500000; 62 - position: relative; 63 - width: 100%; 64 - } 65 - 66 - em.storeref:hover { 67 - background-color: #eeeeee; 68 - } 69 - 70 - *.popup { 71 - display: none; 72 - /* background: url('http://losser.st-lab.cs.uu.nl/~mbravenb/menuback.png') repeat; */ 73 - background: #ffffcd; 74 - border: solid #555555 1px; 75 - position: absolute; 76 - top: 0em; 77 - left: 0em; 78 - margin: 0; 79 - padding: 0; 80 - z-index: 100; 81 - } 82 - 83 - em.storeref:hover span.popup { 84 - display: inline; 85 - width: 40em; 86 - } 87 - 88 - 89 - .logTreeToggle { 90 - text-decoration: none; 91 - font-family: monospace; 92 - font-size: larger; 93 - } 94 - 95 - .errorLine { 96 - color: #ff0000; 97 - font-weight: bold; 98 - } 99 - 100 - .warningLine { 101 - color: darkorange; 102 - font-weight: bold; 103 - } 104 - 105 - .prio3 { 106 - font-style: italic; 107 - } 108 - 109 - code { 110 - white-space: pre-wrap; 111 - } 112 - 113 - .serial { 114 - color: #56115c; 115 - } 116 - 117 - .machine { 118 - color: #002399; 119 - font-style: italic; 120 - } 121 - 122 - ul.vmScreenshots { 123 - padding-left: 1em; 124 - } 125 - 126 - ul.vmScreenshots li { 127 - font-family: monospace; 128 - list-style: square; 129 - }
-30
nixos/lib/test-driver/treebits.js
··· 1 - $(document).ready(function() { 2 - 3 - /* When a toggle is clicked, show or hide the subtree. */ 4 - $(".logTreeToggle").click(function() { 5 - if ($(this).siblings("ul:hidden").length != 0) { 6 - $(this).siblings("ul").show(); 7 - $(this).text("-"); 8 - } else { 9 - $(this).siblings("ul").hide(); 10 - $(this).text("+"); 11 - } 12 - }); 13 - 14 - /* Implementation of the expand all link. */ 15 - $(".logTreeExpandAll").click(function() { 16 - $(".logTreeToggle", $(this).parent().siblings(".toplevel")).map(function() { 17 - $(this).siblings("ul").show(); 18 - $(this).text("-"); 19 - }); 20 - }); 21 - 22 - /* Implementation of the collapse all link. */ 23 - $(".logTreeCollapseAll").click(function() { 24 - $(".logTreeToggle", $(this).parent().siblings(".toplevel")).map(function() { 25 - $(this).siblings("ul").hide(); 26 - $(this).text("+"); 27 - }); 28 - }); 29 - 30 - });
+2 -16
nixos/lib/testing-python.nix
··· 62 62 63 63 requiredSystemFeatures = [ "kvm" "nixos-test" ]; 64 64 65 - buildInputs = [ libxslt ]; 66 - 67 65 buildCommand = 68 66 '' 69 - mkdir -p $out/nix-support 70 - 71 - LOGFILE=$out/log.xml tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver 72 - 73 - # Generate a pretty-printed log. 74 - xsltproc --output $out/log.html ${./test-driver/log2html.xsl} $out/log.xml 75 - ln -s ${./test-driver/logfile.css} $out/logfile.css 76 - ln -s ${./test-driver/treebits.js} $out/treebits.js 77 - ln -s ${jquery}/js/jquery.min.js $out/ 78 - ln -s ${jquery}/js/jquery.js $out/ 79 - ln -s ${jquery-ui}/js/jquery-ui.min.js $out/ 80 - ln -s ${jquery-ui}/js/jquery-ui.js $out/ 67 + mkdir -p $out 81 68 82 - touch $out/nix-support/hydra-build-products 83 - echo "report testlog $out log.html" >> $out/nix-support/hydra-build-products 69 + LOGFILE=/dev/null tests='exec(os.environ["testScript"])' ${driver}/bin/nixos-test-driver 84 70 85 71 for i in */xchg/coverage-data; do 86 72 mkdir -p $out/coverage-data
+2 -14
nixos/lib/testing.nix
··· 58 58 59 59 requiredSystemFeatures = [ "kvm" "nixos-test" ]; 60 60 61 - buildInputs = [ libxslt ]; 62 - 63 61 buildCommand = 64 62 '' 65 - mkdir -p $out/nix-support 66 - 67 - LOGFILE=$out/log.xml tests='eval $ENV{testScript}; die $@ if $@;' ${driver}/bin/nixos-test-driver 68 - 69 - # Generate a pretty-printed log. 70 - xsltproc --output $out/log.html ${./test-driver/log2html.xsl} $out/log.xml 71 - ln -s ${./test-driver/logfile.css} $out/logfile.css 72 - ln -s ${./test-driver/treebits.js} $out/treebits.js 73 - ln -s ${jquery}/js/jquery.min.js $out/ 74 - ln -s ${jquery-ui}/js/jquery-ui.min.js $out/ 63 + mkdir -p $out 75 64 76 - touch $out/nix-support/hydra-build-products 77 - echo "report testlog $out log.html" >> $out/nix-support/hydra-build-products 65 + LOGFILE=/dev/null tests='eval $ENV{testScript}; die $@ if $@;' ${driver}/bin/nixos-test-driver 78 66 79 67 for i in */xchg/coverage-data; do 80 68 mkdir -p $out/coverage-data