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

NUnit3TestAdapter 3.17.0 empty output file regression? #780

Closed
zpqrtbnk opened this issue Sep 1, 2020 · 13 comments
Closed

NUnit3TestAdapter 3.17.0 empty output file regression? #780

zpqrtbnk opened this issue Sep 1, 2020 · 13 comments
Assignees
Milestone

Comments

@zpqrtbnk
Copy link

zpqrtbnk commented Sep 1, 2020

Versions: NUnit v3.12.0, NUnit3TestAdapter v3.17.0.
Visual Studio Pro 2019 v16.7.2.
.NET SDKs & runtimes 2.1.804, 3.1.401, 5.0.100-preview.8.

Running tests as:

dotnet test my.csproj -c Release --no-restore -f netcoreapp3.1 -v normal -- NUnit.WorkDirectory="(path)" NUnit.TestOutputXml="." NUnit.Labels=Before NUnit.Where="(filter)"

With version 3.16.1 of the adapter this produces a result files in (path) will complete details of all tests. With version 3.17.0 of the adapter that same file only contains:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<command-line><![CDATA[path\to\bin\Release\netcoreapp3.1\testhost.dll --port 18533 --endpoint 127.0.0.1:018533 --role client --parentprocessid 13248 --telemetryoptedin false]]></command-line>

That is, command-line as root element without any other content.

Expected: same file as with 3.16.1.

I can repro by switching back and forth the adapter NuGet package between 3.16 and 3.17.

Happy to run more tests or provide more details as needed. Will try to have a look into why this is happening.

@zpqrtbnk
Copy link
Author

zpqrtbnk commented Sep 1, 2020

So... at NUnitEngineAdapter.cs:136 there is

resultWriter.WriteResultFile(testResults.TopNode, path);

and at NUnitResults.cs:50 there is

TopNode = results.Name == "test-run" ? results.FirstChild : results;

which unless I am mistaken makes TopNode be the first child of <test-run>, i.e. <command-line>, thus causing the results file to only contain the <command-line> element?

@sauravwcm
Copy link

Is there a solution or a work around?

@OsirisTerje
Copy link
Member

@sauravwcm The fix is done. Once the PR is through, it should be on the dev feed. Appreciate confirmations :-)

OsirisTerje added a commit that referenced this issue Oct 24, 2020
@OsirisTerje
Copy link
Member

@sauravwcm
Copy link

Thanks @OsirisTerje The solution implemented in the dev package indeed works. Any info on when NUnit3TestAdapter_4.0.0 will be officially released?

@zpqrtbnk
Copy link
Author

Cool Thanks!!

@sauravwcm
Copy link

Has anyone of you observed that "run selected test" feature sometimes fails with NUnit3TestAdapter 4.0.0-dev-01535 on visual studio 2017

@OsirisTerje
Copy link
Member

@sauravwcm No really, but what I have observed is that when I add a new test or change the test name (method or class), it needs to be run twice, once to make it reappear in the test explorer, then again for actually running it. But, not that it sometimes fails or not. Sounds like something flaky. If you can drill down that a bit, slim it, and perhaps come up with a repro ?

@ngyukman
Copy link

Hi, is there any news for an official release after 5 months?

@OsirisTerje
Copy link
Member

@ngyukman Might be able to get one out during easter. Can you confirm the beta is working as it should for you ?

@ngyukman
Copy link

ngyukman commented Mar 31, 2021

@OsirisTerje yes, so far I don't see issues in my execution

@Deadvi5
Copy link

Deadvi5 commented Nov 10, 2022

NUnit3TestAdapter version 4.3.0 used with Stryker.NET still have this issue;
Rollback to version 3.17 fixed the issue

@OsirisTerje
Copy link
Member

Thanks. See issues #1027 and #1028. There is an alpha there with a fix, and a 4.3.1 will be out shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants