How to get missing branches information in coverage.py html report - code-coverage

Currently I am using coverage.py to get coverage report of python code. I am using --branch flag to get branch coverage in the report. In the html report header I am getting these attributes
Module statements missing excluded branches partial coverage
I am looking for an attribute which tells the branches_covered from which I can understand how many branches are covered or missed.
If I create a JSON report, I can see the details in the summary like
"summary": {
"covered_lines": ,
"num_statements": ,
"percent_covered": ,
"percent_covered_display": ,
"missing_lines": ,
"excluded_lines": ,
"num_branches": ,
"num_partial_branches": ,
"covered_branches": ,
"missing_branches":
},
But I don't want to create 2 reports, I am trying to get the attribute "covered_branches" in the html report. I am not able to find solution to this yet.

Related

Jenkins Allure does not generate valid links based on #issue

I have my .featue file which contains at the beginning the annotation #issue=JIRA-123. Afer I run the cucumber Selenium script I get my json outputs. These output contains the following part: "links":[{"name":"JIRA-123","type":"issue"}],
Allure does create a valid report with the issue, but the link does not work correctly.
The following properties had been set in my jenkins. I guess they are correct.
Allure generates the following report and sets the given link for the issue.
The link points directly to the dashboard of the test. What must I change in order to get a valid link in the issue section of the report?

How to get RobotFramework post test results with latest timestamp in Jenkins

I am executing robot test results using timestampoutput command to store results , whenever i execute this it will create me a log & report results ending with timestamp . But my problem is how to get the test report/log in jenkins post results which are generated in that timestamp.Please let me know if this is the right approach or any alternate solution is there. Any guidance is appreciated. Thanks
pybot --outputdir var/test-results/%date:~-4,4%%date:~-10,2%%date:~-7,2% --timestampoutputs
Output: var\test-results\20170601\output-20170601-155017.xml
Log: var\test-results\20170601\log-20170601-155017.html
Report: var\test-results\20170601\report-20170601-155017.html
The date formatting and Jenkins Robot Framework Publish results plugin are two approaches that conflict each other. The publish result plugin copies the contents of the output folder to a new folder that is in line with the build number. This ensures uniqueness and using the Jenkins UI all the information about when a build was initiated is found, it should not need a folder name based on a date.

How to include test case descriptions in lcov/genhtml code coverage output

I'm using lcov to generate code coverage reports for a C code base. I would like to integrate test descriptions into the final output (using lcov's gendesc utility.)
However, I have no clue on how to do that, and documentation on gendesc seems rather sparse (as far as the good old google has been able to tell me.)
The gendesc info at LTP describes how to create the input test case description files (as expected by genhtml). And the genhtml info provides --show-descriptions, and --description-file for inputting such test case description files.
However, I don't know how to reference the test cases so that they get included in the final report. genhtml sees them as unused test cases and thus keeps them out of the generated html output. I can use --keep-descriptions, but that doesn't tell me what test cases were run (obviously because I do not know how to make the reference from code to test description.)
So, how do we tell lcov/genhtml which tests were run in the final output? Any ideas?
To associate a test case name with coverage data, specify that name while collecting coverage data using lcov's --test-name option:
lcov --capture --directory project-dir --output-file coverage.info --test-name "test01"
Then continue with the steps that you already mentioned, that is create a test case description file "tests.txt":
test01
Some test
Convert it into the format expected by genhtml:
gendesc tests.txt --output-filename tests.desc
Finally specify the descriptions file to genhtml:
genhtml coverage.info --output-directory out --description-file tests.desc --show-details

Passing URL parameters to a TFS Report (2010)

I have a very simple report constructed using Report Builder 2.0 talking to analysis services for TFS 2010. The report shows the number of active bugs logged against a particular Team Project, sorted by priority.
I have several team projects, and I don't want to duplicate the same report for each one. Instead, I would like to pass in the team project as a parameter in the URL. A search of the web shows good guidance from John Socha-Leialoha on how to do this (finding the MDX parameter and constructing the query).
I have set a default on the report to point to a particular team project and the report presents the expected information, when I add a parameter to the URL the report fails to run, and displays the following message: 'Value cannot be null. Parameter name: main'
The following URL displays the report correctly with the default team project:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart
I've also tried appending the parameter, as follows:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart&tf:Parameters=TeamProjectTeamProjectHierarchy=[Team Project].[Team Project Hierarchy].&[{E207FAFF-CA70-41A2-8A62-B881C9C9F8F1}]
This, also, generates the message: 'Value cannot be null. Parameter name: main'
This led me to the realization that I needed to escape the & symbol, as follows:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart&tf:Parameters=TeamProjectTeamProjectHierarchy=[Team Project].[Team Project Hierarchy].&26[{E207FAFF-CA70-41A2-8A62-B881C9C9F8F1}]
However, the report still fails to run, and displays the same error message.
Since it is not referenced in Socha's example, I have also tried running the report while omitting the &tf: parameters tag, as follows:
/sites/tfsserver/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Bug+Information/ActiveBugsByPriorityBarChart&TeamProjectTeamProjectHierarchy=[Team Project].[Team Project Hierarchy].&26[{E207FAFF-CA70-41A2-8A62-B881C9C9F8F1}]
This doesn't seem to work either. At this point, I'm happy for any advice/guidance I can get.
Maybe this blog post helps you: http://ewaldhofman.nl/post/2009/06/02/Add-SSRS-report-as-dashboard-to-sharepoint.aspx

How to skip selected error reported by fortify source code analyzer?

While getting scource code analyzed by fortify source code analyzer if I want to skip selected catagory say "Poor Error Handling : Empty Catch Block" - is there any way to do that? In case of checkstyle report generator there is a way to skip selected error being reported. I would like to have that flexibility in case of fortify source code analyzer.
First, open results containing "Poor Error Handling: Empty Catch Block" in Fortify Audit Workbench. Then, find an Empty Catch Block finding, right click it and select "Create Filter..."
In the filter dialog, select the condition "Category matches Poor Error Handling: Empty Catch Block", and then in the Action section below, select "Hide". Save the filter.
The first thing you'll find is all the Empty Catch Block findings have disappeared. The filter is simply stored in the FPR at this stage.
To publish this filter as a matter of policy, choose Tools->Project Configuration and export your project template. Save the file in the installation directory in Core/config/filters/ as specified in the readme file there. If you do this on all your computers that produce scans, all your FPRs will share the same filter.
If you have a central Fortify 360 Server, you can import this project template into the server instead. It will automatically be applied to any upload to a project of that template.

Resources