nunit / nunit/nunit-console

--noresult flag results in TestResult.xml file being written with test results

Open
#1,748 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Confirmation V3
Dominant language
C#
Stars
234
Forks
163
Avg merge
13h 32m
Merged PRs (30d)
25

Description

As the title summarizes: I wanted to run nunit3-console without creating the result file (for testing an issue with the test that is sometimes failing, probably due to the load on the system). I've discovered the --noresult option but upon testing I see that it is still writing test results to TestResult.xml.
Is this correct behavior or bug? Or is there other way to get "quiet" test run?

  • The full command line being used: nunit3-console --test ClassName.AndTestMethodName --inprocess --noresult .\UnitTests.dll
  • Method of installation: chocolatey
  • Version of the NUnit Engine/Console: Nunit3 console: 3.20.1

I can see in the code that specifying --noresult sets property NoResult on ConsoleOptions class to true which later is checked before running the tests but the result of tests is always passed to all objects in ConsoleOptions.ResultOutputSpecifications list.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ConsoleOptions.NoResult handling and follow how ConsoleOptions.ResultOutputSpecifications is used during the nunit3-console run. Reproduce the command with --test, --inprocess, and --noresult against UnitTests.dll, then verify that the no-result run does not write TestResult.xml while preserving the expected test execution behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.