You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,39 @@
3
3
utPLSQL is a Unit Testing framework for Oracle PL/SQL.
4
4
The framework follows industry standards and best patterns of modern Unit Testing frameworks like [JUnit](http://junit.org/junit4/) and [RSpec](http://rspec.info/)
5
5
6
+
- User Guide
7
+
- [Installation](userguide/install.md)
8
+
- [Getting Started](userguide/getting-started.md)
9
+
- [Annotations](userguide/annotations.md)
10
+
- [Expectations](userguide/expectations.md)
11
+
- [Running unit tests](userguide/running-unit-tests.md)
12
+
- [Using the ut_run script](userguide/ut_run-script.md)
13
+
- [Testing best pracitces](userguide/best-practices.md)
Parameters `a_mask` and `a_escape_char` represent a valid parameters of the [Oracle like function](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF52142)
@@ -105,15 +118,15 @@ Unary matcher that validates if the actual value is not null.
Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle regexp_like function](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501)
@@ -205,20 +225,22 @@ Expectations provide a very convenient way to check for a negative of the expect
Copy file name to clipboardExpand all lines: docs/userguide/install.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,12 @@ The installation user/schema must have the following Oracle system permissions d
25
25
26
26
In addition it must be granted execute to the following system packages.
27
27
28
-
- DBMS_LOCK
28
+
- DBMS_LOCK
29
+
30
+
The utPLSQL is using Oracle [DBMS_PROFILER tables](https://docs.oracle.com/cd/E18283_01/appdev.112/e16760/d_profil.htm#i999476). The tables will be created in the installation schema if they do not exist.
31
+
The uninstall process however will not drop those tables, as they can potentially be shared and reused for profiling PLSQL code.
32
+
It is up to DBA to maintain the storage of the profiler tables.
Copy file name to clipboardExpand all lines: docs/userguide/reporters.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,8 +71,8 @@ Example of failure report details
71
71
72
72
#Teamcity reporter
73
73
74
-
[Teamcity](https://www.jetbrains.com/teamcity/) is a CI server by Jetbrains. The CI has it's own format of reporting that allows tracking of progress of a CI step/task as it executes.
75
-
The format developed by Jetbrains is supported by utPLSQL with `ut_teamcity_reporter`.
74
+
[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.
75
+
The TeamCity format developed by Jetbrains is supported by utPLSQL with `ut_teamcity_reporter`.
Copy file name to clipboardExpand all lines: docs/userguide/running-unit-tests.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The `run` API is designed to be called directly by developer, when using IDE/SQL
10
10
The main benefit of using this API is it's simplicity.
11
11
One-line call is enough to execute a set of tests form one or multiple schemes.
12
12
13
-
The **procedures** execute specified tests and produces outputs to DBMS_OUTPUT suing specified reporter
13
+
The **procedures** execute specified tests and produces outputs to DBMS_OUTPUT using specified reporter
14
14
The **functions** can only be used in SELECT statements. They execute specified tests and produce outputs as a pipelined data stream to be consumed by select satement.
15
15
16
16
## ut.run procedures
@@ -24,43 +24,49 @@ end;
24
24
```
25
25
Execute all tests in current schema (_HR_).
26
26
27
+
27
28
```sql
28
29
begin
29
30
ut.run('HR');
30
31
end;
31
32
```
32
33
Execute all tests in specified schema (_HR_).
33
34
35
+
36
+
```sql
37
+
begin
38
+
ut.run('hr:com.my_org.my_project');
39
+
end;
40
+
```
41
+
42
+
Execute all tests from all packages that are on the _COM.MY_ORG.MY_PROJECT_ suitepath.
43
+
Check the [annotations documentation](annotations.md) to find out about suitepaths and how they can be used to group test packages.
44
+
45
+
34
46
```sql
35
47
begin
36
48
ut.run('hr.test_apply_bonus');
37
49
end;
38
50
```
39
51
Execute all tests from package _HR.TEST_APPLY_BONUS_.
Execute all tests from package _HR.TEST_APPLY_BONUS_ and all tests from schema _CUST_.
54
-
Using a list of things to execute allows you to execute a fine-grained set of tests.
55
-
56
-
```sql
57
-
begin
58
-
ut.run('hr:com.my_org.my_project');
59
-
end;
60
-
```
68
+
Using a list of items to execute allows you to execute a fine-grained set of tests.
61
69
62
-
Execute all tests from all packages that are on the _COM.MY_ORG.MY_PROJECT_ suitepath.
63
-
Check the [annotations documentation](annotations.md) to find out about suitepaths and how they can be used to group test packages.
64
70
65
71
**Note:**
66
72
`ut_documentation_reporter` is default reporter for all API's defined for running unit tests.
@@ -75,6 +81,7 @@ end;
75
81
```
76
82
Execute all tests from package _HR.TEST_APPLY_BONUS_ and provide outputs to DBMS_OUTPUT using the XUnit reporter.
77
83
84
+
78
85
For details on build-in reporters look at [reporters documentation](reporters.md).
79
86
80
87
## ut.run functions
@@ -91,15 +98,15 @@ select * from table(ut.run('hr.test_apply_bonus', ut_xunit_reporter()));
91
98
92
99
The `ut_runner` provides API for integrating utPLSQL with other products. Maven, Jenkins, SQL Develper, PL/SQL Developer, TOAD and others can leverage this API to call utPLSQL.
93
100
94
-
The main difference as compared to `ut.run` API is that the `ut_runner.run` does not provide outputs.
101
+
The main difference as compared to `ut.run` API is that the `ut_runner.run` does not print outputs to the screen.
95
102
96
103
`ut_runner.run` accepts multiple reporters. Each reporter produces outputs into a separate output (uniquely identified by output_id).
97
104
Outputs of multiple reporters can be consumed in parallel. This allows for live reporting of test execution progress with threads and several database sessions.
98
105
99
106
The concept is pretty simple.
100
107
101
-
- in main thread (session), define the reporters to be used. Each reporter has it's output_id and so you need to extract and store those output_id's.
108
+
- in the main thread (session), define the reporters to be used. Each reporter has it's output_id and so you need to extract and store those output_id's.
102
109
- as a separate thread, start the `ut_runner.run` and pass reporters with previously defined output_id's
103
110
- for each reporter start a separate thread and read outputs from `ut_output_buffer.get_lines` table function by providing the output_id defined in the main thread.
104
111
105
-
112
+
`ut_runner.run` is internally used by the [`ut_run.sql` script](ut_run-script.md) which is a utility for running tests with multiple reporters and provides parameters to save reporters results into individual files on the local file system.
0 commit comments