nunit: NUnit 3.4: NUnit.ConsoleRunner is not picking up NUnit.Extension.NUnitV2ResultWriter

When running NUnit.ConsoleRunner and NUnit.Extension.NUnitV2ResultWriter nuget packages in the following layout

.\tools\NUnit.ConsoleRunner\tools\nunit3-console.exe .\tools\NUnit.Extension.NUnitV2ResultWriter\tools\nunit-v2-result-writer.dll

the call "C:\some\dir\tools\NUnit.ConsoleRunner\tools\nunit3-console.exe" "C:\some\dir\src\Tests\Test.Assembly.dll" "--work=C:\some\dir\tests" --full "--result=C:\some\dir\tests\TestResult.xml;format=nunit2" --labels=All --noheader succeeds when both packages have version 3.2.1 but fails if both packages have version 3.4.0. The error message is Unknown result format: nunit2

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (20 by maintainers)

Most upvoted comments

@CharliePoole #tool will only install tools it knows about, but the extensions can be added into the tools\packages.config file.

I cannot reproduce this. My tools\packages.config looks like this

<?xml version="1.0" encoding="utf-8"?>
<packages>
    <package id="Cake" version="0.13.0" />
  <package id="NUnit.Extension.NUnitV2Driver" version="3.4.0" />
  <package id="NUnit.Extension.NUnitV2ResultWriter" version="3.4.0" />
</packages>

Which produces a directory structure like that given in the report.

image

My cake test task looks like,

Task("Test-nunit-v2")
    .IsDependentOn("Build")
    .Does(() =>
{
    NUnit3("./nunit-v2/bin/" + configuration + "/nunit-v2.dll",
        new NUnit3Settings {
            Results = "TestResults-v2.xml",
            ResultFormat = "nunit2"
        });
});

And the result of running tests is the expected,

========================================
Test-nunit-v2
========================================
Executing task: Test-nunit-v2
NUnit Console Runner 3.4.0
Copyright (C) 2016 Charlie Poole

Runtime Environment
   OS Version: Microsoft Windows NT 10.0.14366.0
  CLR Version: 4.0.30319.42000

Test Files
    C:/src/github/nunit-tests/nunit-v2/bin/Release/nunit-v2.dll


Test Run Summary
  Overall result: Passed
  Test Count: 5, Passed: 5, Failed: 0, Inconclusive: 0, Skipped: 0
  Start time: 2016-06-28 02:06:18Z
    End time: 2016-06-28 02:06:18Z
    Duration: 0.168 seconds

Results (nunit2) saved as C:/src/github/nunit-tests/TestResults-v2.xml
Finished executing task: Test-nunit-v2

Notice the nunit2 result format and this is a 2.6.4 test, so the v2 driver extension worked. NUnit was originally in my path, but I removed it, so that wasn’t the reason it worked. I caught that when I didn’t have the v2 driver listed 😄

Source code for this is at https://github.com/rprouse/nunit-tests

I am moving this out of the milestone and switching to confirm until we get more info. I believe @nalla is in Korea, so he probably won’t be able to respond until tomorrow our time because of the time difference.

@nalla if you can provide more information on how to reproduce, we might get a fix in the 3.4.1 release since it may not happen tonight.