Skip to content

Commit

Permalink
Review doc on reports
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Aug 7, 2024
1 parent 5ae11e8 commit a8cf95a
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 15 deletions.
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ This is an example of the summary report of a test session:
- [Reporting](#reporting)
- [Report generation](#report-generation)
- [Content of the reports](#content-of-the-reports)
- [Include the source code](#include-the-source-code)
- [Contributing and Architecture](#contributing-and-architecture)

## Quick Start
Expand Down Expand Up @@ -260,12 +261,14 @@ where:
- count: number of coverage rules generated.
- error: number of coverage rules that have not been evaluated because some error.

Class name is clickable to display a report that contains the details for queries that have been evaluated,
identified by the method name and line number:
Each class name is clickable to display a report that contains the details for queries that have been evaluated:

![Example of a summary report](docs/image-class.png)
![Example of a summary report](docs/image-class-1.png)
...
![Example of a summary report](docs/image-class-2.png)

Method name is clickable to show the detail of each coverage rule (covered in green, uncovered in yellow):
Clicking the down arrow near the percent coverage and the query executed
shows the details of each coverage rule (covered in green, uncovered in yellow):
- A textual message that explains the test situation that the coverage rule represents.
If a coverage rule is not covered, a test and/or the appropriate test data may be added in order to cover it.
- The SQL representation of the coverage rule.
Expand All @@ -275,6 +278,35 @@ Method name is clickable to show the detail of each coverage rule (covered in gr
- count: number of times that the coverage rule has been executed.
- category, type, subtype, location: A classification about where the coverage rule comes from.

### Include the source code

The general syntax of the report generator has four parameters, only the two first ones are required
if you do not include the source code of the classes under test:
```
<rules-folder> <reports-folder> [<source-folders> [project-folder]]
```
On Java, if you want to include the source code in the reports, you have to set a value for the third parameter
`<source-folders>` to include a comma-separate list of the path(s) to locate the sources. For example:
- If executing the reports from the root of a maven Java project,
set `src/main/java`.
- If executing the reports form the root of a multimodule Java project (parent project) with two modules,
set `module1/src/main/java,module2/src/main/java`.
On .NET, you have to set a value for the third and fourth parameter.
The reason is that the location of source files does not exactly match the namespaces, so that,
the FPC coverage rules store the absolute path of the class source files that has to be
resolved to a relative path before report generation. For example:
- If executing the reports from a solution folder that contains a project, set both parameters to `.`
- If executing the reports from the unit tests in a solution that contains a project,
set both parameters to `../../../..` (because the default directory where the tests run
is four levels down the solution folder)
- If executing the reports from a solution folder that contains a project,
but the reports where generated inside a container that runs a server application under the `/app` folder,
set the parameters as `.` `/app` (The `/app` value allows to resolve the relative path of each source file
from the project folder).
## Contributing and Architecture
See the general contribution policies and guidelines for *giis-uniovi* at
Expand Down
Binary file added docs/image-class-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/image-class-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/image-class.png
Binary file not shown.
Binary file modified docs/image-index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions net/resources/qacover-report/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions qacover-core/src/test/resources/qacover-report/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang='en'>
<head>
<title>SQL Query Fpc Coverage</title>
<title>SQL Query FPC Coverage</title>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>
<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css' integrity='sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk' crossorigin='anonymous'>
Expand All @@ -17,7 +17,7 @@

<body>
<div class='container'>
<h2>SQL Query Fpc Coverage</h2>
<h2>SQL Query FPC Coverage</h2>
<table class="table table-striped table-sm">
<tr><th>Class</th><th>%</th><th></th><th>qrun</th><th>qcount</th><th>qerror</th><th>dead</th><th>count</th><th>error</th></tr>
<tr class='class-row'>
Expand Down
4 changes: 2 additions & 2 deletions qacover-core/src/test/resources/qacover-uber-main/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang='en'>
<head>
<title>SQL Query Fpc Coverage</title>
<title>SQL Query FPC Coverage</title>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>
<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css' integrity='sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk' crossorigin='anonymous'>
Expand All @@ -17,7 +17,7 @@

<body>
<div class='container'>
<h2>SQL Query Fpc Coverage</h2>
<h2>SQL Query FPC Coverage</h2>
<table class="table table-striped table-sm">
<tr><th>Class</th><th>%</th><th></th><th>qrun</th><th>qcount</th><th>qerror</th><th>dead</th><th>count</th><th>error</th></tr>
<tr class='class-row'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html lang='en'>
<head>
<title>SQL Query Fpc Coverage</title>
<title>SQL Query FPC Coverage</title>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, shrink-to-fit=no'>
<link rel='stylesheet' href='https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css' integrity='sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk' crossorigin='anonymous'>
Expand All @@ -17,7 +17,7 @@

<body>
<div class='container'>
<h2>SQL Query Fpc Coverage</h2>
<h2>SQL Query FPC Coverage</h2>
<table class="table table-striped table-sm">
<tr><th>Class</th><th>%</th><th></th><th>qrun</th><th>qcount</th><th>qerror</th><th>dead</th><th>count</th><th>error</th></tr>
<tr class='class-row'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public void run(String rulesFolder, String reportFolder, String sourceFolders, S
CoverageSummary totals = classes.getSummary();
String indexRowsHeader = indexWriter.getBodyRow("TOTAL", totals.getQrun(), totals.getQcount(), totals.getQerror(), totals.getCount(),
totals.getDead(), totals.getError());
String indexContent = indexWriter.getHeader("SQL Query Fpc Coverage")
+ indexWriter.getBodyContent("SQL Query Fpc Coverage", indexRowsHeader + indexRowsSb.toString());
String indexContent = indexWriter.getHeader("SQL Query FPC Coverage")
+ indexWriter.getBodyContent("SQL Query FPC Coverage", indexRowsHeader + indexRowsSb.toString());
FileUtil.fileWrite(reportFolder, "index.html", indexContent);
consoleWrite(classes.size() + " classes generated, see index.html at reports folder");
}
Expand Down

0 comments on commit a8cf95a

Please sign in to comment.