Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d9c129

Browse files
authored
Merge pull request #290 from jgebal/bugfix/documentation_fixes
Updated invalid headers in documentation.
2 parents 521e5e2 + 470c5ad commit 4d9c129

10 files changed

Lines changed: 30 additions & 25 deletions

File tree

docs/about/license.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Version Information
1+
# Version Information
22

33
**utPLSQL version 3** is licensed under [Apache 2.0]
44
(https://www.apache.org/licenses/LICENSE-2.0)

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The framework follows industry standards and best patterns of modern Unit Testin
2424
- [Contributing](about/CONTRIBUTING.md)
2525

2626

27-
#Three steps
27+
# Three steps
2828
With just three simple steps you can define and run your unit tests for PLSQL code.
2929

3030
1. Install the utPLSQL framework

docs/userguide/annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ create or replace package test_pkg is
5858
end test_pkg;
5959
```
6060

61-
#Annotations description
61+
# Annotations description
6262

6363
| Annotation |Level| Description |
6464
| --- | --- | --- |

docs/userguide/best-practices.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Best Practices
1+
# Best Practices
22

33
The following are best practices we as utPLSQL have learned about PL/SQL and Unit Testing.
44

@@ -22,4 +22,3 @@ The following are best practices we as utPLSQL have learned about PL/SQL and Uni
2222

2323
Use a version control system for your code. Don't just trust the database for code storage. This includes both the code you have under test, and the unit tests you develop as well.
2424

25-

docs/userguide/coverage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Following code coverage reporters are supplied with utPLSQL:
1616
* `ut_coveralls_reporter` - generates a JSON coverage report providing detailed information on code coverage with line numbers. This coverage report is designed to be consumed by cloud services like [coveralls](https://coveralls.io)
1717
* `ut_coverage_sonar_reporter` - generates a JSON coverage report providing detailed information on code coverage with line numbers. This coverage report is designed to be consumed by local services like [sonarqube](https://about.sonarqube.com/)
1818

19-
##Security model
19+
## Security model
2020
Code coverage is using DBMS_PROFILER to gather information about execution of code under test and therefore follows the [DBMS_PROFILER's Security Model](https://docs.oracle.com/database/121/ARPLS/d_profil.htm#ARPLS67465)
2121
In order to be able to gather coverage information, user executing unit tests needs to be either:
2222
* Owner of the code that is tested
@@ -28,7 +28,7 @@ If you have `execute` privilege on the code that are tested, but do not have `cr
2828
If you have `execute` privilege only on the unit tests, but do not have `execute` privilege on the code that is tested, the code will not be reported by coverage - as if it did not exist in the database.
2929
If the code that is testes is complied as NATIVE, the code coverage will not be reported as well.
3030

31-
##Running unite tests with coverage
31+
## Running unite tests with coverage
3232
Using code coverage functionality is as easy as using any other [reporter](reporters.md) for utPLSQL project. All you need to do is run your tests from your preferred SQL tool and save the outcomes of reporter to a file.
3333
All you need to do, is pass the constructor of the reporter to your `ut.run`
3434

@@ -51,13 +51,13 @@ The report allow to navigate to every source and inspect line by line coverage.
5151
![Coverage Details page](../images/coverage_html_details.png)
5252

5353

54-
##Coverage reporting options
54+
## Coverage reporting options
5555
By default the database schema/schemes containing the tests that were executed during the run, are fully reported by coverage reporter.
5656
All valid unit tests are excluded from the report regardless if they were invoked or not. This way the coverage report is not affected by presence of tests and contains only the tested code.
5757

5858
The default behavior of coverage reporters can be altered, depending on your needs.
5959

60-
###Including/excluding objects in coverage reports
60+
### Including/excluding objects in coverage reports
6161
The most basic options are the include/exclude objects lists.
6262
You may specify both include and exclude objects lists to specify which objects are to be included in the report and which are to be excluded.
6363
Both of those options are meant to be used to narrow down the scope of unit test runs, that is broad by default.
@@ -76,7 +76,7 @@ Executes test `test_award_bonus` and gather on all objects in schema `ut3_user`
7676

7777
You can also combine the parameters and both will be applied.
7878

79-
###Defining different schema name(s)
79+
### Defining different schema names
8080
In some architectures, you might end up in a situation, where your unit tests exist in a different schema than the tested code.
8181
This is not the default or recommended approach but is supporter by utPLSQL.
8282
In such scenarios, you would probably have a separate database schema to hold unit tests and a separate schema/schemes to hold the tested code.
@@ -108,7 +108,7 @@ end;
108108
```
109109
Executes test `test_award_bonus` in schema `ut3_user` and gather coverage for that execution on `award_bonus` object from schema `usr`. The exclude list is of no relevance as it is not overlapping with include list.
110110

111-
###Working with projects and project files
111+
### Working with projects and project files
112112
Both `sonar` and `coveralls` are utilities that are more project-oriented than database-centric. They report statistics and coverage for project files in version control system.
113113
Nowadays, most of database projects are moving away from database-centric approach towards project/product-centric approach.
114114
Coverage reporting of utPLSQL allows you to perform code coverage analysis for your project files.

docs/userguide/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sqlplus admin/admins_password@xe @@install_headless.sql
1111
```
1212

1313

14-
#Recommended Schema
14+
# Recommended Schema
1515
It is recommended to install utPLSQL in it's own schema. You are free to choose any name for this schema.
1616

1717
The installation user/schema must have the following Oracle system permissions during the installation.

docs/userguide/reporters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
utPLSQL provides the following reporting formats.
22

3-
#Documentation reporter
3+
# Documentation reporter
44

55
The `ut_documentation_reporter` is the default reporting format used by the framework.
66
It provides a human readable test results.
@@ -34,7 +34,7 @@ The documentation report provides the following information.
3434
- Summary with total number of tests, number of tests with status and timing for the execution
3535

3636

37-
##Color output from documentation reporter
37+
## Color output from documentation reporter
3838

3939
When invoking tests with documentation reporter and your command line supports ANSICONSOLE (default on Unix), you can obtain the coloured outputs from the documentation reporter.
4040

@@ -49,7 +49,7 @@ Example outputs from documentation reporter.
4949
![doc_reporter_outputs](../images/documentation_reporter_color.png)
5050

5151

52-
#XUnit reporter
52+
# XUnit reporter
5353

5454
Most of continuous integration servers (like Jenkins) are capable of consuming unit test execution results in [XUnit/JUnit](https://en.wikipedia.org/wiki/XUnit) format.
5555
The `ut_xunit_reporter` is producing outcomes as XUnit-compatible XML unit test report, that can be used by CI servers to display their custom reports and provide metrics (like tests execution trends).
@@ -69,7 +69,7 @@ Example of failure report details
6969
![xunit_reporter_outputs](../images/xunit_reporter_jenkins_errors.png)
7070

7171

72-
#Teamcity reporter
72+
# Teamcity reporter
7373

7474
[Teamcity](https://www.jetbrains.com/teamcity/) is a CI server by Jetbrains. It supports XUnit reporting and additionally has it's own format of reporting that allows tracking of progress of a CI step/task as it executes.
7575
The TeamCity format developed by Jetbrains is supported by utPLSQL with `ut_teamcity_reporter`.

docs/userguide/upgrade.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#How to upgrade from prior versions
1+
# How to upgrade from prior versions
22

3-
TODO: Finish this documentation.
3+
TODO: Finish this documentation.

docs/userguide/ut_run-script.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ It allows saving of outcomes into multiple output files.
33
It also facilitates displaying on screen unit test results while the execution is still ongoing.
44
Current limit of script parameters is 39
55

6-
#Scrip invocation
6+
# Scrip invocation
77
ut_run.sql user/password@database [-p=(ut_path|ut_paths)] [-c] [-f=format [-o=output] [-s] ...]
88

9-
#Parameters
9+
# Parameters
1010
```
1111
user - username to connect as
1212
password - password of the user

readme.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,13 @@ sqlplus admin/admins_password@xe @@install_headless.sql
119119

120120
For detailed instructions on other install options see the [Install Guide](docs/userguide/install.md)
121121

122-
# Example test package
122+
# Example unit test packages
123123

124-
The below test package is a fully-functional Unit Test package for testing a function `betwnstr`.
125-
Package specification is annotated with special comments ([annotations](docs/userguide/annotations.md)).
124+
The below test package is a fully-functional Unit Test package for testing a [`betwnstr` function](examples/between_string/betwnstr.sql).
125+
Package specification is [annotated](docs/userguide/annotations.md) with special comments.
126126
Annotations define that a package is a unit test suite, they also allow defining a description for the suite as well as the test itself.
127127
Package body consists of procedures containing unit test code. To validate [an expectation](docs/userguide/expectations.md) in test, use `ut.expect( actual_data ).to_( ... )` syntax.
128128

129-
130129
```sql
131130
create or replace package test_between_string as
132131

@@ -150,7 +149,7 @@ create or replace package body test_between_string as
150149

151150
procedure normal_case is
152151
begin
153-
ut.expect( betwnstr( '1234567', 2, 5 ) ).to_equal('2345') );
152+
ut.expect( betwnstr( '1234567', 2, 5 ) ).to_( equal('2345') );
154153
end;
155154

156155
procedure zero_start_position is
@@ -172,6 +171,13 @@ end;
172171
/
173172
```
174173

174+
Have a look st the structure of our [demo project](https://github.com/utPLSQL/utPLSQL-demo-project/)
175+
The project is installing few example packages from the [source directory](https://github.com/utPLSQL/utPLSQL-demo-project/tree/develop/source),
176+
installing the test packages from [test directory](https://github.com/utPLSQL/utPLSQL-demo-project/tree/develop/test)
177+
and finally executing all the tests using [Travis CI](https://travis-ci.org/utPLSQL/utPLSQL-demo-project).
178+
The [test results](https://sonarqube.com/component_measures/metric/tests/list?id=utPLSQL%3AutPLSQL-demo-project)
179+
together with [code coverage](https://sonarqube.com/component_measures/metric/coverage/list?id=utPLSQL%3AutPLSQL-demo-project)
180+
are published to the [projects Sonar page](https://sonarqube.com/dashboard?id=utPLSQL%3AutPLSQL-demo-project) after every successful build.
175181

176182
# Running tests
177183

0 commit comments

Comments
 (0)