|
1 | | -The `ut_run.sql` script is designed to allow invocation of utPLSQL with multiple reporters. |
| 1 | +The `ut_run.bat` and `ut_run` scripts are designed to allow invocation of utPLSQL with multiple reporters. |
2 | 2 | It allows saving of outcomes into multiple output files. |
3 | 3 | It also facilitates displaying on screen unit test results while the execution is still ongoing. |
4 | 4 | Current limit of script parameters is 39 |
5 | 5 |
|
6 | | -# Scrip invocation |
7 | | - ut_run.sql user/password@database [-p=(ut_path|ut_paths)] [-c] [-f=format [-o=output] [-s] ...] |
| 6 | +The easiest way to use it, is by adding the client_source/sqlplus folder on your PATH. |
| 7 | + |
| 8 | +# Script Invocation |
| 9 | + ut_run user/password@database [-p=(ut_path|ut_paths)] [-c] [-f=format [-o=output] [-s] ...] [-source_path=path] [-test_path=path] |
8 | 10 |
|
9 | 11 | # Parameters |
10 | 12 | ``` |
11 | | - user - username to connect as |
12 | | - password - password of the user |
13 | | - database - database to connect to |
14 | | - -p=ut_path(s)- A path or a comma separated list of paths to unit test to be executed. |
15 | | - The path can be in one of the following formats: |
16 | | - schema[.package[.procedure]] |
17 | | - schema:suite[.suite[.suite][...]][.procedure] |
18 | | - Both formats can be mixed in the comma separated list. |
19 | | - If only schema is provided, then all suites owner by that schema (user) are executed. |
20 | | - If -p is omitted, the current schema is used. |
21 | | - -f=format - A reporter to be used for reporting. |
22 | | - Available options: |
23 | | - -f=ut_documentation_reporter |
24 | | - A textual pretty-print of unit test results (usually use for console output) |
25 | | - -f=ut_teamcity_reporter |
26 | | - A teamcity Unit Test reporter, that can be used to visualize progress of test execution as the job progresses. |
27 | | - -f=ut_xunit_reporter |
28 | | - A XUnit xml format (as defined at: http://stackoverflow.com/a/9691131 and at https://gist.github.com/kuzuha/232902acab1344d6b578) |
29 | | - Usually used by Continuous Integration servers like Jenkins/Hudson or Teamcity to display test results. |
30 | | - If no -f option is provided, the ut_documentation_reporter will be used. |
31 | | -
|
32 | | - -o=output - file name to save the output provided by the reporter. |
33 | | - If defined, the output is not displayed on screen by default. This can be changed with the -s parameter. |
34 | | - If not defined, then output will be displayed on screen, even if the parameter -s is not specified. |
35 | | - If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration. |
36 | | - -s - Forces putting output to to screen for a given -f parameter. |
37 | | - -c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards |
| 13 | + user - username to connect as |
| 14 | + password - password of the user |
| 15 | + database - database to connect to |
| 16 | + -p=ut_path(s) - A path or a comma separated list of paths to unit test to be executed. |
| 17 | + The path can be in one of the following formats: |
| 18 | + schema[.package[.procedure]] |
| 19 | + schema:suite[.suite[.suite][...]][.procedure] |
| 20 | + Both formats can be mixed in the comma separated list. |
| 21 | + If only schema is provided, then all suites owner by that schema (user) are executed. |
| 22 | + If -p is omitted, the current schema is used. |
| 23 | + -f=format - A reporter to be used for reporting. |
| 24 | + Available options: |
| 25 | + -f=ut_documentation_reporter |
| 26 | + A textual pretty-print of unit test results (usually use for console output) |
| 27 | + -f=ut_teamcity_reporter |
| 28 | + A teamcity Unit Test reporter, that can be used to visualize progress of test execution as the job progresses. |
| 29 | + -f=ut_xunit_reporter |
| 30 | + A XUnit xml format (as defined at: http://stackoverflow.com/a/9691131 and at https://gist.github.com/kuzuha/232902acab1344d6b578) |
| 31 | + Usually used by Continuous Integration servers like Jenkins/Hudson or Teamcity to display test results. |
| 32 | + -f=ut_coverage_html_reporter |
| 33 | + Generates a HTML coverage report providing summary and detailed information on code coverage. |
| 34 | + The html reporter is based on open-source simplecov-html reporter for Ruby. |
| 35 | + It includes source code of the code that was covered (if possible). |
| 36 | + -f=ut_coveralls_reporter |
| 37 | + Generates a JSON coverage report providing detailed information on code coverage with line numbers. |
| 38 | + This coverage report is designed to be consumed by cloud services like https://coveralls.io/. |
| 39 | + -f=ut_coverage_sonar_reporter |
| 40 | + Generates a JSON coverage report providing detailed information on code coverage with line numbers. |
| 41 | + This coverage report is designed to be consumed by local services like https://about.sonarqube.com/. |
| 42 | + -f=ut_sonar_test_reporter |
| 43 | + Generates a JSON report providing detailed information on test specifications. |
| 44 | + This report is designed to be consumed by local services like https://about.sonarqube.com/. |
| 45 | + If no -f option is provided, the ut_documentation_reporter will be used. |
| 46 | +
|
| 47 | + -o=output - file name to save the output provided by the reporter. |
| 48 | + If defined, the output is not displayed on screen by default. This can be changed with the -s parameter. |
| 49 | + If not defined, then output will be displayed on screen, even if the parameter -s is not specified. |
| 50 | + If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration. |
| 51 | + -s - Forces putting output to to screen for a given -f parameter. |
| 52 | + -source_path=path - Source files path to be used by coverage reporters. |
| 53 | + -test_path=path - Test files path to be used by coverage reporters. |
| 54 | + -c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards |
38 | 55 | ``` |
39 | 56 |
|
| 57 | +**To make coverage reporters work source_path and/or test_path cannot be empty, and ut_run need to be executed from your project's path.** |
| 58 | + |
40 | 59 | Parameters -f, -o, -s are correlated. That is parameters -o and -s are defining outputs for -f. |
41 | 60 |
|
42 | 61 | Examples of invocation using sqlplus from command line: |
43 | 62 |
|
44 | | -`sqlplus /nolog @ut_run hr/hr@xe -p=hr_test -f=ut_documentation_reporter -o=run.log -s -f=ut_teamcity_reporter -o=teamcity.xml` |
| 63 | +`ut_run @ut_run hr/hr@xe -p=hr_test -f=ut_documentation_reporter -o=run.log -s -f=ut_html_reporter -o=coverage.html -source_path=source` |
45 | 64 |
|
46 | 65 | All Unit tests from schema/package "hr_test" will be be invoked with two reporters: |
47 | 66 | - ut_documentation_reporter - will output to screen and save it's output to file "run.log" |
48 | | - - ut_teamcity_reporter - will save it's output to file "teamcity.xml" |
| 67 | + - ut_html_reporter - will read file structure from source folder, and save it's output to file "coverage.html" |
49 | 68 |
|
50 | | -`sqlplus /nolog @ut_run hr/hr@xe` |
| 69 | +`ut_run hr/hr@xe` |
51 | 70 |
|
52 | | -All Unit tests from schema "hr" will be be invoked with ut_documentation_reporter as a format and the results will be printed to screen |
| 71 | +All Unit tests from schema "hr" will be be invoked with ut_documentation_reporter as a format and the results will be printed to screen. |
0 commit comments