Skip to content

couperyork/NUnitOutputVersionIssue

Repository files navigation

Reproducing NUnit3 Console Error:

Missing Version Number in Nunit2 Test Output XML

Objective:

This repository aims to demonstrate an error in the NUnit3 Console, specifically when passing an invalid assembly as a first argument. The error leads to the absence of a version number in the Nunit2 format test output XML generated by the NUnit3 Console.

This can cause downstream effects such as; failing CI pipelines that use the Jenkins Xunit Publishing plugin.

How to Reproduce the Error:

To reproduce this error, follow these steps:

  1. Navigate to the Repository after Cloning:

    cd NUnitOutputVersionIssue
  2. Ensure NUnit3 Console is Installed: Ensure that NUnit3 Console is installed on your system. This test assumes a version greater than 3.15.0. I have been able to reproduce using versions 3.15.4, 3.16.0 & 3.17.0:

    choco install nunit-console-runner
  3. Ensure NUnit V2 Result Writer is Installed: Ensure that the NUnit V2 Result Write is installed on your system. This test used version NUnit V2 Result Writer 3.7.0:

    choco install nunit-extension-nunit-v2-result-writer
  4. Build the Solution: Ensure the solution is built to produce the dlls we will use as inputs into the NUnit3-Console:

    dotnet build .\NUnitOutputVersionIssue.sln
  5. Run NUnit3 Console with an Invalid Assembly: Execute the following command, notice the name of the invalid assembly at the front:

    nunit3-console NUnitOutputVersionIssueB\bin\Debug\NUnitOutputVersionIssueCC.dll NUnitOutputVersionIssue\bin\Debug\NUnitOutputVersionIssue.dll -result TestA.xml;format=nunit2
  6. Observe the Output XML: After running the command, observe the test output XML generated by NUnit3 Console. Note the absence of a version number in the XML file.

  7. Run NUnit3 Console with Valid Assemblies: To contrast, execute the following command with valid assemblies:

    nunit3-console NUnitOutputVersionIssueB\bin\Debug\NUnitOutputVersionIssueB.dll NUnitOutputVersionIssue\bin\Debug\NUnitOutputVersionIssue.dll -result TestB.xml;format=nunit2
  8. Observe the Output XML: After running the command, observe the test output XML generated by NUnit3 Console. Note the presence of a version number in the XML file.

  9. Run NUnit3 Console with an Invalid Assembly provided secondly: Execute the following command, swapping positions of the invalid assembly with the valid one:

    nunit3-console NUnitOutputVersionIssue\bin\Debug\NUnitOutputVersionIssue.dll NUnitOutputVersionIssueB\bin\Debug\NUnitOutputVersionIssueCC.dll -result TestC.xml;format=nunit2
  10. Observe the Output XML: After running the command, observe the test output XML generated by NUnit3 Console. Note the presence of a version number in the XML file.

Expected Outcome:

The expected outcome is to observe that when an invalid assembly is passed to NUnit3 Console paired with a valid assembly, the resulting test output XML file should contain a version number. However, the demonstrated error will show the absence of this version number.

Additional Notes:

  • This project is using .NET Framework 4.7.2
  • Ensure that the invalid assembly provided is indeed invalid to reproduce the error accurately.
  • This repository serves as a minimal setup to reproduce the error and can be expanded upon for further investigation or testing purposes.
  • Link to GitHub Issue
  • It's possible that this could've been introduced before version 3.15.0, I haven't tested on any earlier versions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages