Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HtmlTransform-v3.xslt and update HtmlSummary-v3.xslt to make html consistent #10

Merged
merged 3 commits into from
Sep 9, 2016

Conversation

harrisonmeister
Copy link
Contributor

This provides output for HtmlTransform as below:
htmltransform-v3

Also raw html output:

<html>
<body>
<style type="text/css">

      .strong {
      font-weight: bold;
      }

      .smllabel {
      width:110px;
      font-weight: bold;
      }

      td.left {
      text-align: left;
      }

      td.right {
      text-align: right;
      }

      li {
      font-family: monospace
      }
      .collapsed
      {
      border:0;
      border-collapse: collapse;
      }

    </style>
<h4>Runtime Environment</h4>
<table id="runtime">
  <tr>
    <td class="smllabel right">OS Version:</td>
    <td class="left">Microsoft Windows NT 10.0.10586.0</td>
  </tr>
  <tr>
    <td class="smllabel right">CLR Version:</td>
    <td class="left">4.0.30319.42000</td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td class="smllabel right">NUnit Version:</td>
    <td class="left">3.4.1.0</td>
  </tr>
</table>
<div id="testfiles">
  <h4>Test Files</h4>
  <ol>
    <li>C:\Users\mark.harrison\Documents\visual studio 2015\Projects\ClassLibrary1\bin\Debug\ClassLibrary1.dll</li>
    <li>C:\Users\mark.harrison\Documents\visual studio 2015\Projects\ClassLibrary1\bin\Debug\ClassLibrary1.dll</li>
  </ol>
</div>
<h4>Tests Not Run</h4>
<ol>
  <li>
    <pre>Explicit : ClassLibrary1.ExplicitTests.The_TEST<br />Some Explicit reason</pre>
  </li>
  <li>
    <pre>Ignored : ClassLibrary1.NormalTests.IgnoreMe<br />Some Ignore reason</pre>
  </li>
  <li>
    <pre>Explicit : ClassLibrary1.ExplicitTests.The_TEST<br />Some Explicit reason</pre>
  </li>
  <li>
    <pre>Ignored : ClassLibrary1.NormalTests.IgnoreMe<br />Some Ignore reason</pre>
  </li>
</ol>
<h4>Errors and Failures</h4>
<ol>
  <li>
    <pre>Invalid : ClassLibrary1.BadFixture.SomeTest<br />OneTimeSetUp: No suitable constructor was found</pre>
  </li>
  <li>
    <pre>Error : ClassLibrary1.NormalTests.Error_Case<br />System.ApplicationException : error happened<br />   at ClassLibrary1.NormalTests.Error_Case() in C:\Users\mark.harrison\Documents\Visual Studio 2015\Projects\ClassLibrary1\Class1.cs:line 46</pre>
  </li>
  <li>
    <pre>Failed : ClassLibrary1.NormalTests.Failure_Case<br />Intentional Failure<br />at ClassLibrary1.NormalTests.Failure_Case() in C:\Users\mark.harrison\Documents\Visual Studio 2015\Projects\ClassLibrary1\Class1.cs:line 40
</pre>
  </li>
  <li>
    <pre>Invalid : ClassLibrary1.BadFixture.SomeTest<br />OneTimeSetUp: No suitable constructor was found</pre>
  </li>
  <li>
    <pre>Error : ClassLibrary1.NormalTests.Error_Case<br />System.ApplicationException : error happened<br />   at ClassLibrary1.NormalTests.Error_Case() in C:\Users\mark.harrison\Documents\Visual Studio 2015\Projects\ClassLibrary1\Class1.cs:line 46</pre>
  </li>
  <li>
    <pre>Failed : ClassLibrary1.NormalTests.Failure_Case<br />Intentional Failure<br />at ClassLibrary1.NormalTests.Failure_Case() in C:\Users\mark.harrison\Documents\Visual Studio 2015\Projects\ClassLibrary1\Class1.cs:line 40
</pre>
  </li>
</ol>
<h4>Run Settings</h4>
<ul>
  <li>
        DefaultTimeout: 900000</li>
  <li>
        WorkDirectory: D:\TestResults</li>
  <li>
        ImageRuntimeVersion: 4.0.30319</li>
  <li>
        ImageTargetFrameworkName: .NETFramework,Version=v4.5</li>
  <li>
        ImageRequiresX86: False</li>
  <li>
        ImageRequiresDefaultAppDomainAssemblyResolver: False</li>
  <li>
        NumberOfTestWorkers: 8</li>
</ul>
<h4>Test Run Summary</h4>
<table id="summary" class="collapsed">
  <tr>
    <td class="smllabel right">Overall result:</td>
    <td class="left">Failed</td>
  </tr>
  <tr>
    <td class="smllabel right">Test Count:</td>
    <td class="left">14, Passed: 2, Failed: 6, Inconclusive: 2, Skipped: 4</td>
  </tr>
  <tr>
    <td class="smllabel right">Failed Tests: </td>
    <td class="left">
            Failures: 2, Errors: 2, Invalid: 2</td>
  </tr>
  <tr>
    <td class="smllabel right">Skipped Tests: </td>
    <td class="left">
            Ignored: 2, Explicit: 2, Other: 0</td>
  </tr>
  <tr>
    <td class="smllabel right">Start time: </td>
    <td class="left">2016-09-08 14:54:27Z</td>
  </tr>
  <tr>
    <td class="smllabel right">End time: </td>
    <td class="left">2016-09-08 14:54:27Z</td>
  </tr>
  <tr>
    <td class="smllabel right">Duration: </td>
    <td class="left">0.141 seconds
        </td>
  </tr>
</table></body>
</html>

Questions

  1. Should we add the where clauses in. This could be problematic to try to "parse" them to match the syntax exactly. We could just keep it simple and just show the commands like the xml does in bullet points e.g. list items
  2. Should we add the command line options into the summaries (for the default + both html)

…2 consistent html, plus more maintainable

Completes #5
@@ -85,6 +85,9 @@
<ItemGroup>
<EmbeddedResource Include="Transforms\HtmlSummary-v3.xslt" />
</ItemGroup>
<ItemGroup>
<Content Include="Transforms\HtmlTransform-v3.xslt" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an EmbeddedResource?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good spot. Updated

@rprouse
Copy link
Contributor

rprouse commented Sep 9, 2016

This is looking good. I think we should add in the command line options like we do on the command line. I think that will satisfy the where clause too.

BTW, just saw your commit in response to my comment. You're quick 👍

@harrisonmeister
Copy link
Contributor Author

@rprouse - should we add the command line in for all transforms, or just default and both html?

@rprouse
Copy link
Contributor

rprouse commented Sep 9, 2016

@harrisonmeister I think we should add it to all of the full transforms and leave it out of the summaries. If we aren't putting errors in the summaries, I don't see the point of the command line, but then again, I don't really see much use in the summaries 😄

@harrisonmeister
Copy link
Contributor Author

harrisonmeister commented Sep 9, 2016

I've added the command line section to the HtmlSummary and the DefaultTransform for v3.

<h4>Command Line</h4>
<pre>"D:\Git\Source\packages\NUnit.ConsoleRunner\tools\nunit3-console.exe"  "--noheader" "--where=!(cat == 'Integration' || cat == 'IntegrationTest' || cat == 'IntegrationsTest' || cat == 'IntegrationTests' || cat == 'IntegrationsTests' || cat == 'Integration Test' || cat == 'Integration Tests' || cat == 'Integrations Tests' || cat == 'Approval Tests' || cat == 'AcceptanceTest' || cat == 'PerformanceTest')" "--labels=Off" "--timeout=900000" "--result=D:\Testresults\testing-nunit3.xml" "--result=D:\Testresults\testing-nunit2.xml;format=nunit2" "C:\Users\mark.harrison\Documents\visual studio 2015\Projects\ClassLibrary1\bin\Debug\ClassLibrary1.dll" "C:\Users\mark.harrison\Documents\visual studio 2015\Projects\ClassLibrary1\bin\Debug\ClassLibrary1.dll"</pre>

command-line-v3

@CharliePoole
Copy link
Owner

I figured we should have a general discussion of formatting before the release, so I created issue #9 for that purpose. Although it's not how we usually work, I think it may go faster if we finish up this issue, #6 and #2 before going back for a final review and comparison of everything. If nothing else, it will be a second chance to change what the output looks like. When we get to that point, I figured I would put up a side-by-side comparison for us to review.

@harrisonmeister
Copy link
Contributor Author

Ok, do you want me to combine the changes in this branch to #8 ?

@CharliePoole
Copy link
Owner

@harrisonmeister If a filter has been used, the <test-run> element will contain a <filter> element with the XML representation of the filter. And, of course, we have the command-line.

My suggestion is to leave this out for now. We can discuss it along with #9 and possibly create an enhancement issue for post-1.0 working.

@CharliePoole
Copy link
Owner

@rprouse I created the summaries for my own use, so I can give you a use case.

You have multiple XML result files and there is no external indication of which ones passed and which one's failed. You use the -brief option with wildcard input and a single file (or the console) for output. The resulting output has just a few lines per test run, which you can easily scan.

@CharliePoole
Copy link
Owner

This looks good to me... merging.

@CharliePoole CharliePoole merged commit c5db871 into master Sep 9, 2016
@CharliePoole CharliePoole deleted the v3-transforms branch September 9, 2016 16:14
@harrisonmeister
Copy link
Contributor Author

Cool thanks. I should be able to get to #8 early next week.

@CharliePoole
Copy link
Owner

@harrisonmeister We generally don't combine things, except in the rare case where two issues involve changing code in the same place.

After a while, creating separate issues and PRs is second nature and doesn't seem like extra work. :-)

@harrisonmeister
Copy link
Contributor Author

harrisonmeister commented Sep 9, 2016

No worries, and makes sense. I think I got confused as the PR got closed, and then merged :)
If you want me to remove the command line options from 3 let me know, and I can create a new PR.

@CharliePoole
Copy link
Owner

As a future reference, we assume any PR is ready to be merged once reviewed and approved unless it's otherwise indicated. Sometimes we will create the PR early so we have a place for discussion or because work is still ongoing. In that case, we put a notice like Do Not Merge Yet at the top of the description. When we are ready to merge, we add a comment and edit the description.

@harrisonmeister
Copy link
Contributor Author

Thanks @CharliePoole for the info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants