How to publish results using dotnet test command

前端 未结 3 1777
后悔当初
后悔当初 2021-02-01 16:14

I have a test project written in dotnet core. This need to publish the results in an XML or HTML format. Is there a way I can publish the results to a particular directory using

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 16:57

    I couldn't get this to work using the syntax provided in the answer of Eric Erhardt.

    Using the TRX Logger examples here I was able to recreate the correct syntax.

    dotnet test --logger:"trx;LogFileName=C:\Temp\TestResults.xml" MyLibraryToTest.dll

    $ dotnet test --logger:"trx;LogFileName=C:\Temp\TestResults.xml" MyLibraryToTest.dll
    Microsoft (R) Test Execution Command Line Tool Version 16.8.1
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    Starting test execution, please wait...
    A total of 1 test files matched the specified pattern.
    Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 51459
    Only local connections are allowed.
    Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
    ChromeDriver was started successfully.
    Results File: C:\Temp\TestResults.xml
    
    Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: 7 s - MyLibraryToTest.dll (net5.0)
    

提交回复
热议问题