SonarQube Scanner can't parse nUnit 3 test reuslts - sonarqube-scan

It's look like SonarQube scanner 6 can't parse NUnit 3's TestResult.xml.
Is there any way to parse NUnit 3's test results into the NUnit 2 format?

Found it!
NUnit 3 has a option to convert his new test results format into NUnit 2's format :
-result:reports\TestResult.xml;format=nunit2

Related

Cucumber HTML reports in Jenkins using python

I am trying to create a test step in Jenkins using a python script. This python script will be used to automate regression tests. These tests are in a GitHub repository and what my python script will do is manipulate the requests after reading one test case at a time and send it across to the server which will return a pass or fail for that test case.
I wanted to visualize the test results of this python script and I stumbled upon Cucumber reports for Jenkins. I have installed the plugin and I wanted to know how to generate the HTML report of the tests I am going to execute using my python script.
Is there a way to create the json report in Python and feed that to the Cucumber UI plugin to generate the HTML report? Thanks! Please let me know what do I need to read/do to accomplish this task.
Based on my experience, but with Java, we were doing the following:
In your Runner class, you set a path to your json cucumber report, smth like (I took this example from here: Cucumber Report Path:
#CucumberOptions(
features = "src/test/resources/functionalTests",
glue= {"stepDefinitions"},
plugin = { "pretty", "json:target/cucumber-reports/Cucumber.json" },
monochrome = true
)
Jenkins has Cucumber Reports on Jenkins plugin for Cucumber reports
This plugin can 'eat' your json file report and will build a beautiful graphs for each build run.
Hope it will help you.

Can I include only some aspect in the coverage report of Jest/Enzyme

I am using the Jest coverage report after my tests are run to check the coverage of my code. Although in this, I have the 4 values
1. Statements
2. Branches
3. Functions
4. Lines
Is there any way I can display only the statements and not the other 3 properties in the coverage report or is it always autogenerated with all 4 properties?
If there is a way, how do I do that?

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.

TFS Test - mstest log output - final test results

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

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'

Resources