TFS Test - mstest log output - final test results - visual-studio-2012

A couple of days ago our vs2012 mstest started producing two logs of test results in the one session, the initial "Results Top Level Tests" then Final Test Results:" "Results Top Level Tests"
As we parse the file, naturally we came undone with two lots of results.
Why is their two lots of results and - or how was this triggered ?
What is "Final Test Results" about?
(the console output from mstest is piped to a file)
Thanks

Based on my test, the issue should be caused by the test cases or the test processes which have something wrong. And the "Final Test Results" will appear there.
Simply say, when the message "Final Test Results" appears, that means maybe there are something wrong with the configuration of your test project or test processes.
So, please check and debug the test cases, processes, environments etc...
Firstly make sure the tests running without any error within local Visual Studio.
Reference:
MSTest hangs when used from command line
MSTest.exe command-line options

Related

Puppet Development Kit test unit with multiple output targets

We have introduced the PDK lately into our developments chain and are now trying to make everybody happy with the test outputs it generates.
We need an output as JUnit test report for our jenkins jobs. That we have solved.
And we need the output still on the console because some of the developers find it very annoying having to open the JUnit report file before they can see failed tests.
pdk test unit --format=junit:report.xml
Is how we configured the output for JUnit.
Unfortunately as soon as you configure the JUnit report no output gets printed on the console/stdout anymore. Even if you add another format like --format=text without target file.
Is there a way to achieve both without running the PDK twice?
It doesn't appear to be in the docs, but this should work.
pdk test unit --format=junit:report.xml --format=text:stdout
See https://github.com/puppetlabs/pdk/blob/7b2950bc5fb2e88ead7321c82414459540949eb1/lib/pdk/cli/util/option_normalizer.rb#L10-L24
I've filed a ticket to ensure that gets promoted to the docs at https://puppet.com/docs/pdk/1.x/pdk_reference.html#pdk-test-unit-command
From PDK documentation
--format=[:]
Specifies the format of the output. Optionally, you can specify a target file
for the given output format,
such as --format=junit:report.xml . Multiple --format options can be
specified as long as they all have distinct output targets
So I believe ,you can try as below
pdk test unit --tests=testcase_name --format=junit:report.xml --format=text:log.txt
Hope it helps.

Android Studio Unit Tests With Coverage Showing 0% On Everything

I'm trying to check my unit test coverage, all my tests are passing, but when I run the tests with 'Run Tests With Coverage' by right clicking on my test file, when it completes, everything comes back as 0%?
Looks like it's supposed to just work reading https://developer.android.com/studio/test/index.html and can't find anything saying why it would be returning 0% for everything?
Is there some hidden setting I'm missing to get this working?
Go to Run->Edit Configuration->Code coverage.
Add your package/class for which you want to run tests, in Packages and classes to record coverage data section.
Also, check Enable coverage in test folders option.
Click Apply and Ok. Re-run your tests with coverage.

TFS Build VS Test Runner - Run only tests with no TestCategory

I currently have around 6000+ tests running on over 30+ projects.
Some of these tests are only able to run locally, so have been decorated with the attribute:
TestCategory="Manual Tests"
this also applies to any functional tests, these are decorated with:
TestCategory="Functional Tests" etc...
I have read a number of MSDN and user articles on this and have setup a build to run only the Functional Tests
Test Case Filter: TestCategory=Functional Tests
(This successfully runs only the Functional Tests)
Question is, is there a test case filter I could use that will ignore both the TestCategory "Functional Tests" and "Manual Tests" and only run the tests that have not been decorated with a TestCategory Attribute.
If have used the below filter cases with no joy:
**Test Case Filter:**
!Functional Tests|!Manual Tests
TestCategory!=Functional Tests|Manual Tests
TestCategory!=Functional Tests|!Manual Tests
TestCategory!=Functional Tests|TestCategory=Manual Tests
TestCategory!=Functional Tests||TestCategory=Manual Tests
(TestCategory!=Functional Tests)|(TestCategory=Manual Tests)
(TestCategory!=Functional Tests)||(TestCategory=Manual Tests)
I am running this on Visual Studio 2012 (Update 4) with TFS 2012 (Update 4)
Many Thanks
Fix the issue by using "()" around your filter. Also | is or, and & is and so using x!=y or y!=z will not work. Use & for not equal to evaluations.
/TestCaseFilter:"(TestCategory!=PreTest&TestCategory!=PostTest&TestCategory!=CleanUp)"
Start small then build up..have you just tried one statement, say:
TestCategory!='Functional Tests'
Looking at the documentation my first punt for the full command would be:
TestCategory!='Functional Tests'&TestCategory!='Manual Tests'

nUnit Test Runner - Test stays in "Not run" if it takes over a certain amount of time

We have some Selenium tests built with nUnit that take quite a while to complete. We are finding that they stay in the "Not run tests" grouping even though they should pass.
After some initial investigation we found that if we remove some long running steps the tests will pass correctly but as soon as we shove a sleep in the code that waits for a couple of minutes the problem comes back.
We are using Visual Studio 2012 with the nUnit Test Runner extension as shown here: http://nunit.org/index.php?p=vsTestAdapter&r=2.6.2
Is there some hidden timeout in nUnit or the test runner that we need to change to get our tests (no matter how long they take) to pass or is there some other problem at work here?

Code Coverage VSMDI on Visual Studio 2012 says "There is no test with specified Id"

I have a solution that is still using VSMDI files.
Running tests are still fine, but when I try to Analyze Code Coverage on the selected test, It shows "Empty results generated".
Looking at the Output Log from Tests, it says
"There is no test with specified Id {09c3a333-1a28-27bf-2d79-8f6aa8fe5e3a}."
From what I see, the Id mentioned is the Test Id in VSMDI file
Does anybody why this happen ?

Resources