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

reqnroll + nunit4 tests produce 2 sets of standard output #505

Open
Ninelya opened this issue Feb 27, 2025 · 3 comments
Open

reqnroll + nunit4 tests produce 2 sets of standard output #505

Ninelya opened this issue Feb 27, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@Ninelya
Copy link

Ninelya commented Feb 27, 2025

Reqnroll Version

2.3.0

Which test runner are you using?

NUnit

Test Runner Version Number

4.3.2

.NET Implementation

.NET 6.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

we don't have reqnroll.json

Issue Description

output looks like this.

Image

when I switch back to Nunit 3.14, output goes back to normal, no duplication. So my guess is this some kind of integration issue with Nunit 4.
when I switch back to specflow, nothing changes, output is still duplicated.
we also have raw nUnit tests without bdd, they don't have this issue.

our dependencies look like this, nothing fancy:

Image

I specified MS test explorer as execution method, but it also reproduces on our CI pipeline, where tests are triggered by a command line.

please help :)

Steps to Reproduce

I wish I knew :)

Link to Repro Project

No response

@Ninelya Ninelya added the bug Something isn't working label Feb 27, 2025
@304NotModified
Copy link
Contributor

Thanks for reporting.

Could you see something in the generated code that leads to this behavior?

@Ninelya
Copy link
Author

Ninelya commented Feb 28, 2025

considering I don't really know how it should look like, nothing stands out to me :)

@304NotModified
Copy link
Contributor

I think it has something to do with this:

public override void WriteTestOutput(string message)
{
TestContext.WriteLine(message);
// avoid duplicate output entries in NUnit for scenario, forward only if no scenario active
if (_contextManager.Value.ScenarioContext == null)
base.WriteTestOutput(message);
}
public override void WriteToolOutput(string message)
{
TestContext.WriteLine("-> " + message);
// avoid duplicate output entries in NUnit for scenario, forward only if no scenario active
if (_contextManager.Value.ScenarioContext == null)
base.WriteToolOutput(message);
}

But not sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants