nunit-console.exe hangs after a few hundred tests - nunit

please help me:
I run nunit in in the windows console.
After more than 300 tests the programm hangs. I don't konw why.
C:\Projekte\Sochi2014_TP_testing\reporting>"NUnit 2.6"\bin\nunit-console.exe /la
bels /out=NUnitTestResult.txt /xml=NUnitTestResult.xml ..\bin\x86\Debug\Sochi201
4_TP_testing.dll
NUnit-Console version 2.6.0.12051
Copyright (C) 2002-20011 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Version: 2.0.50727.5456 ( Net 3.5 )
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-3.5
Log4Net not configured. Looked for file: C:\Projekte\Sochi2014_TP_testing\bin\x8
6\Debug\log4net.config
More details for my issue:
I use selenium and specflow.
Nunit hangs up in a "Scenario Outline". The previous test runs normal. The browser (FF 13) is open and runs normal when I use the mouse.

My guess is that you have a test with a deadlock. You can add a timeout to NUnit:
nunit-console /timeout=10000 (other options as before)
This adds a 10 second timeout to each test. Then you should be able to see which test times out, and work out where the problem is. The number of tests shouldn't be an issue - my Noda Time project has thousands of tests which run without a problem, and I'm sure that's far from the biggest project using NUnit...

Related

Azure devops not running xunit tests

In test run log I have Run UnitTests step, which uses Visual Studio Test. However I see log message:
No test is available in C:\stuff\Debug\x64\bin\x86\ilc\MyApp.Test.dll some_other_dlls Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Test are visible in visual studio, and I can run all of them (I have over 50 tests).
I have xunit.runner.visualstudio package installed. What I am missing, why Azure ignores my tests?
**************** Starting test execution *********************
\vstest.console.exe "#C:\path\fadisfjla.tmp"
Microsoft (R) Test Execution Command Line Tool Version 16.4.0
Copyright (c) Microsoft Corporation. All rights reserved.
vstest.console.exe "C:\dir\Release\x64\bin\arm\MyApp.Test\testhost.dll"
"C:\dir\Release\x64\bin\arm\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll"
"C:\dir\Release\x64\bin\arm\ilc\MyApp.Test.dll"
"C:\dir\Release\x64\bin\x86\MyApp.Test\testhost.dll"
"C:\dir\Release\x64\bin\x86\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll"
"C:\dir\Release\x64\bin\x86\ilc\MyApp.Test.dll"
/Settings:"C:\tmp\fadslfj.tmp.runsettings"
/EnableCodeCoverage
/Logger:"trx"
/TestAdapterPath:"C:\dir\Release\x64"
Starting test execution, please wait...
Test run will use DLL(s) built for framework .NETFramework,Version=v4.0 and platform X86. Following DLL(s) do not match framework/platform settings.
testhost.dll is built for Framework .NETStandard,Version=v1.4 and Platform AnyCPU.
xunit.runner.visualstudio.uwp.testadapter.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
MyApp.Test.dll is built for Framework .NETFramework,Version=v4.0 and Platform ARM.
testhost.dll is built for Framework .NETStandard,Version=v1.4 and Platform AnyCPU.
xunit.runner.visualstudio.uwp.testadapter.dll is built for Framework .NETCore,Version=v5.0 and Platform AnyCPU.
Go to more details on managing these settings.
Microsoft (R) Coverage Collection Tool Version 16.0.30319.200
Copyright (c) Microsoft Corporation. All rights reserved.
1.5873
A total of 6 test files matched the specified pattern.
No test is available in C:\dir\Release\x64\bin\arm\MyApp.Test\testhost.dll C:\dir\Release\x64\bin\arm\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll C:\dir\Release\x64\bin\arm\ilc\MyApp.Test.dll C:\dir\Release\x64\bin\x86\MyApp.Test\testhost.dll C:\dir\Release\x64\bin\x86\MyApp.Test\xunit.runner.visualstudio.uwp.testadapter.dll C:\dir\Release\x64\bin\x86\ilc\MyApp.Test.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Microsoft (R) Coverage Collection Tool Version 16.0.30319.200
Copyright (c) Microsoft Corporation. All rights reserved.
Results File: C:\path\fdsfdsfd.trx
Attachments:
C:\path\file-dfsfdsfe.coverage
Vstest.console.exe exited with code 0.
In my project file
<PackageReference Include="xunit.runner.visualstudio">
<Version>2.4.1</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
First, make sure you have added the xunit.runner.visualstudio package. And then make sure you have pointed to your generated test assemblies under Test selection/Test filesin Visual Studio Test task, for example:
**\bin\$(BuildConfiguration)\**\*test*.dll
!**\obj\**
!**\xunit.runner.visualstudio.testadapter.dll
!**\xunit.runner.visualstudio.dotnetcore.testadapter.dll
Check the following link:
https://xunit.net/docs/getting-test-results-in-azure-devops
It turns out that if You have UWP project for Windows version 1803, and refrence it from test project in this version it ignores all tests in test project. I think this is issue in xunit or windows sdk. If just test project is updated to 1903 it works flawlessly.

how to call boost libraries on appveyor, how to set environment variable to run boost test successfully?

I want to run boost test in appveyor. My code can built successfully without boost test. When I run boost test, it has compile error.
Build started
2
git clone -q --branch=master https://github.com/Gaussma/StaticLibrary.git c:\projects\myproject
3
git checkout -qf 857f43f706d59e6ed74d7af6771d102850e615a0
4
msbuild "c:\projects\myproject\StaticLibrary.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
5
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
6
Copyright (C) Microsoft Corporation. All rights reserved.
7
8
LinkedListcpp.cpp
9
MathFuncsLib.cpp
10
Generating Code...
11
MathFuncsLib.vcxproj -> c:\projects\myproject\x64\Debug\MathFuncsLib.lib
12
boostTest_LinkedList.cpp
13
c:\projects\myproject\myexecrefslib\boosttest_linkedlist.cpp(3): fatal error C1083: Cannot open include file: 'boost/test/included/unit_test.hpp': No such file or directory [c:\projects\myproject\MyExecRefsLib\MyExecRefsLib.vcxproj]
Cleary, the appveyor can not find the boost library.
Locally, I am using Visual Studio 2017 and boost library 1_68_0 to generate the MyExecRefsLib.vcxproj file.
I search on the stackoverflow and find others implement the .yml file in this way.
environment:
BOOST_ROOT: C:\Libraries\boost_1_59_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib64-msvc-14.0
I update it correspondingly for boost_1_67_0 since I am using Visual Studio 2017 in appveyor and boost already installed in appveyor Virtual Machine.
https://www.appveyor.com/docs/windows-images-software/#boost
environment:
BOOST_ROOT: C:\Libraries\boost_1_67_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_67_0\lib64-msvc-14.1
I do not have .yml file , I set those two the environmental variables manually in the project's setting in appveyor.
I am wondering what is the correction setting for those two environment variables to run boost test? Current setting has compile error.
Acutually, this is very easy question. We should make the build environment are same between my local machine and appveyor.
In appveyor :
environment:
BOOST_ROOT: C:\Libraries\boost_1_64_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_64_0\lib64-msvc-14.1
In Visual Studio :
Project-> Properties-> C/C++ ->General -> Additional Include Directories : C:\Libraries\boost_1_64_0
Project-> Properties->Linker -> Additional Library Dependencies : C:\Libraries\boost_1_64_0\lib64-msvc-14.1
Just move the boost_1_64_0 in the Libraries and change the library from stage_x8\lib to lib64-msvc-14.1 is OK.

Why doesn't VSTS Build "Visual Studio Test" step find my NUnit tests?

I've configured a VSTS build job to build my MockingFrameworkExamples .NET 4.7.1 (C#) solution from GitHub. This solution includes five assemblies with NUnit v3.10 unit tests.
I included a Visual Studio Test step in the build definition, but when it runs, the console output says no tests were available in the test assemblies:
No test is available in D:\a\1\s\MSFakesExamples\bin\Release\MSFakesExamples.dll D:\a\1\s\MoqExamples\bin\Release\MoqExamples.dll D:\a\1\s\NSubstituteExamples\bin\Release\NSubstituteExamples.dll D:\a\1\s\RhinoMocksExamples\bin\Release\RhinoMocksExamples.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
What do I need to change to have the test runner to find and run my tests?
My local Visual Studio 2017 instance has no trouble finding and running the tests. The documentation for the Visual Studio Test step says it will run NUnit tests:
Test frameworks that have a Visual Studio test adapter such as xUnit, NUnit, Chutzpah, etc. can also be run.
I've made sure the assemblies are actually building and I've also utilized the Typemock SmartRunner build step to run the tests, which finds and executes them (though, it fails with the MS Fakes assembly, so I can't just use it).
Below are the full build step configuration and the console output from the "Visual Studio Test" step. The build process is configured to run on a "Hosted VS2017" agent.
2018-07-19T18:28:28.1197107Z ##[section]Starting: VsTest - testAssemblies
2018-07-19T18:28:28.1205564Z ==============================================================================
2018-07-19T18:28:28.1205798Z Task : Visual Studio Test
2018-07-19T18:28:28.1206209Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test runner. Test frameworks that have a Visual Studio test adapter such as xUnit, NUnit, Chutzpah, etc. can also be run. Tests can be distributed on multiple agents using this task (version 2).
2018-07-19T18:28:28.1206596Z Version : 2.136.10
2018-07-19T18:28:28.1206775Z Author : Microsoft Corporation
2018-07-19T18:28:28.1207003Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=835764)
2018-07-19T18:28:28.1207231Z ==============================================================================
2018-07-19T18:28:28.6970694Z Run the tests locally using vstest.console.exe
2018-07-19T18:28:28.6971006Z ========================================================
2018-07-19T18:28:28.6971725Z Test selector : Test assemblies
2018-07-19T18:28:28.6972103Z Test assemblies : **\release\*examples*.dll,!**\release\typemock*examples*.dll,!**\obj\**
2018-07-19T18:28:28.6972430Z Test filter criteria : null
2018-07-19T18:28:28.6972706Z Search folder : D:\a\1\s
2018-07-19T18:28:28.6972990Z Run settings file : D:\a\1\s
2018-07-19T18:28:28.6973481Z Run in parallel : false
2018-07-19T18:28:28.6973748Z Run in isolation : false
2018-07-19T18:28:28.6975710Z Path to custom adapters : null
2018-07-19T18:28:28.6975982Z Other console options : null
2018-07-19T18:28:28.6976254Z Code coverage enabled : true
2018-07-19T18:28:28.6976788Z Rerun failed tests: false
2018-07-19T18:28:28.6977166Z VisualStudio version selected for test execution : latest
2018-07-19T18:28:29.7035629Z ========================================================
2018-07-19T18:28:30.0191054Z [command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" #D:\a\_temp\88c64f61-8b81-11e8-a282-258e7155540f.txt
2018-07-19T18:28:33.5193511Z Microsoft (R) Test Execution Command Line Tool Version 15.7.2
2018-07-19T18:28:33.5198868Z Copyright (c) Microsoft Corporation. All rights reserved.
2018-07-19T18:28:33.5199025Z
2018-07-19T18:28:33.5440200Z vstest.console.exe
2018-07-19T18:28:33.5441525Z "D:\a\1\s\MSFakesExamples\bin\Release\MSFakesExamples.dll"
2018-07-19T18:28:33.5442179Z "D:\a\1\s\MoqExamples\bin\Release\MoqExamples.dll"
2018-07-19T18:28:33.5442549Z "D:\a\1\s\NSubstituteExamples\bin\Release\NSubstituteExamples.dll"
2018-07-19T18:28:33.5442909Z "D:\a\1\s\RhinoMocksExamples\bin\Release\RhinoMocksExamples.dll"
2018-07-19T18:28:33.5443312Z /EnableCodeCoverage
2018-07-19T18:28:33.5443575Z /logger:"trx"
2018-07-19T18:28:35.6891585Z Starting test execution, please wait...
2018-07-19T18:28:42.3946126Z Microsoft (R) Coverage Collection Tool Version 15.0.30319.1
2018-07-19T18:28:42.3947458Z
2018-07-19T18:28:42.3947721Z
2018-07-19T18:28:42.3948539Z Copyright (c) Microsoft Corporation. All rights reserved.
2018-07-19T18:28:42.3949162Z
2018-07-19T18:28:42.3949300Z
2018-07-19T18:28:42.3949487Z
2018-07-19T18:28:42.3949624Z
2018-07-19T18:28:42.6811429Z 2.7184
2018-07-19T18:28:53.8206723Z No test is available in D:\a\1\s\MSFakesExamples\bin\Release\MSFakesExamples.dll D:\a\1\s\MoqExamples\bin\Release\MoqExamples.dll D:\a\1\s\NSubstituteExamples\bin\Release\NSubstituteExamples.dll D:\a\1\s\RhinoMocksExamples\bin\Release\RhinoMocksExamples.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
2018-07-19T18:28:53.9442220Z Microsoft (R) Coverage Collection Tool Version 15.0.30319.1
2018-07-19T18:28:53.9443798Z
2018-07-19T18:28:53.9445199Z
2018-07-19T18:28:53.9465185Z Copyright (c) Microsoft Corporation. All rights reserved.
2018-07-19T18:28:53.9465983Z
2018-07-19T18:28:53.9466184Z
2018-07-19T18:28:53.9466360Z
2018-07-19T18:28:53.9466554Z
2018-07-19T18:28:54.6483114Z
2018-07-19T18:28:54.6491201Z Attachments:
2018-07-19T18:28:54.6491635Z D:\a\1\s\TestResults\324c9712-62bd-4959-b3b6-40bebf7c05ec\VssAdministrator_factoryvm-az243 2018-07-19 18_28_41.coverage
2018-07-19T18:28:54.6491944Z
2018-07-19T18:28:54.6574103Z Additionally, path to test adapters can be specified using /TestAdapterPath command. Example /TestAdapterPath:<pathToCustomAdapters>.
2018-07-19T18:28:54.6717566Z ##[warning]No results found to publish.
2018-07-19T18:28:54.7119869Z ##[section]Finishing: VsTest - testAssemblies
It turns out I had to add a NuGet reference to each of the unit test assemblies to the NUnit3TestAdapter NuGet package for this to work. No other config changes were needed.
You need to specify the path to the NUnit adapter using /TestAdapterPath.

WinDbg can't open dumps "Dbghelp version mismatch"

This is something like the question WinDbg: Version mismatch of dbghelp.dll when trying to attach to a process
However, I can't post to that question and the marked answer isn't really an answer and doesn't work for me.
I have a machine which I used to use for debugging crash dumps, but suddenly it fails to open any dumps, always reporting
dbghelp.dll has a version mismatch with the debugger
Microsoft (R) Windows Debugger Version 10.0.14321.1024 X86
Copyright (c) Microsoft Corporation. All rights reserved.
command line: '"C:\Program Files (x86)\Windows Kits\Debuggers\x86\windbg.exe" -c ".cmdtree c:\cmdtree.txt"
dbgeng: image 10.0.14321.1024, built Sat Jul 16 09:31:09 2016
[path: C:\Program Files (x86)\Windows Kits\Debuggers\x86\dbgeng.dll]
dbghelp: image 10.0.14321.1024, built Sat Jul 16 09:29:50 2016
[path: C:\Program Files (x86)\Windows Kits\Debuggers\x86\dbghelp.dll]
DIA version: 40116
So it's complaining of a mismatch, but there is no apparent mismatch.
The version of dbghelp and dbgeng in System32 and SysWOW64 is 6.1.7601.17514. But note that:
a) According to Microsoft page on DbgHelp, the version in Windows and WinDbg does not need to be (and probably shouldn't be) synced
b) I have another machine where I have installed 10.0.14321.1024 version of WinDbg, and it also has version 6.1.7601.17514 of dbghelp and dbgeng in Windows folders, and everything's working fine on that machine.
Any assistance appreciated.
This machine is basically bricked as far as analyzing crash dumps is concerned. I've tried reinstalling windbg, and installing different versions, still the same error occurs.

nunit command in bash do not accept static command?

I have a Program.dll which I execute with Nunit GUI Runner on windows 7. Works perfect. The [Test] method is static.
When I execute it through bash in linux, in the XML it says :
signature is not correct: it must be an instance method.
here is the method declaration
[Test]
static public void NUnitWriter()
why does it work in windows with the Nunit GUI runner but not with it's linux console counterpart?
It's possible you're using an older version of the console application; static test methods weren't supported until version 2.5. You can check the version by running
> nunit-console.exe /?
NUnit-Console version 2.6.4.14350
Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
...
If it's 2.4 or earlier, that's your problem.