@@ -39,87 +39,89 @@ export LC_ALL=en_US.utf-8
3939The charset-part of LC_ALL is ignored.
4040
4141## Usage
42+ Currently, utPLSQL-cli supports the following commands:
43+ - run
44+ - info
45+ - reporters
4246
43- ` utplsql run <ConnectionURL> [-p=(ut_path|ut_paths)] [-f=format [-o=output_file] [-s] ...] `
47+ #### \ < ConnectionURL>
4448
45- ```
46- <ConnectionURL> - accepted formats:
47- <user>/<password>@//<host>[:<port>]/<service>
48- <user>/<password>@<host>:<port>:<SID>
49- <user>/<password>@<TNSName>
50- To connect using TNS, you need to have the ORACLE_HOME environment variable set.
51- The file tnsnames.ora must exist in path %ORACLE_HOME%/network/admin
52- The file tnsnames.ora must contain valid TNS entries.
49+ This is used in all commands as first parameter (though it's optional for ` info ` ).
50+
51+ Accepted formats:
52+
53+ - ` <user>/<password>@//<host>[:<port>]/<service> `
54+ - ` <user>/<password>@<host>:<port>:<SID> `
55+ - ` <user>/<password>@<TNSName> `
56+
57+ To connect using TNS, you need to have the ORACLE_HOME environment variable set.
58+ The file tnsnames.ora must exist in path %ORACLE_HOME%/network/admin
59+ The file tnsnames.ora must contain valid TNS entries.
60+
61+ ### run
62+ ` utplsql run <ConnectionURL> [<options>] `
63+
64+
65+ #### Options
66+ ```
5367-p=suite_path(s) - A suite path or a comma separated list of suite paths for unit test to be executed.
5468 The path(s) can be in one of the following formats:
5569 schema[.package[.procedure]]
5670 schema:suite[.suite[.suite][...]][.procedure]
5771 Both formats can be mixed in the list.
5872 If only schema is provided, then all suites owner by that schema are executed.
5973 If -p is omitted, the current schema is used.
74+
6075-f=format - A reporter to be used for reporting.
6176 If no -f option is provided, the default ut_documentation_reporter is used.
62- Available options:
63- -f=ut_documentation_reporter
64- A textual pretty-print of unit test results (usually use for console output)
65- -f=ut_teamcity_reporter
66- For reporting live progress of test execution with Teamcity CI.
67- -f=ut_xunit_reporter
68- Used for reporting test results with CI servers like Jenkins/Hudson/Teamcity.
69- -f=ut_coverage_html_reporter
70- Generates a HTML coverage report with summary and line by line information on code coverage.
71- Based on open-source simplecov-html coverage reporter for Ruby.
72- Includes source code in the report.
73- -f=ut_coveralls_reporter
74- Generates a JSON coverage report providing information on code coverage with line numbers.
75- Designed for [Coveralls](https://coveralls.io/).
76- -f=ut_coverage_sonar_reporter
77- Generates a JSON coverage report providing information on code coverage with line numbers.
78- Designed for [SonarQube](https://about.sonarqube.com/) to report coverage.
79- -f=ut_sonar_test_reporter
80- Generates a JSON report providing detailed information on test execution.
81- Designed for [SonarQube](https://about.sonarqube.com/) to report test execution.
82-
83- -o=output - Defines file name to save the output from the specified reporter.
77+ See reporters command for possible values
78+ -o=output - Defines file name to save the output from the specified reporter.
8479 If defined, the output is not displayed on screen by default. This can be changed with the -s parameter.
8580 If not defined, then output will be displayed on screen, even if the parameter -s is not specified.
8681 If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration.
87- -s - Forces putting output to to screen for a given -f parameter.
82+ -s - Forces putting output to to screen for a given -f parameter.
83+
8884-source_path=source - path to project source files, use the following options to enable custom type mappings:
89- -owner="app"
90- -regex_expression="pattern"
91- -type_mapping="matched_string=TYPE[/matched_string=TYPE]*"
92- -owner_subexpression=subexpression_number
93- -type_subexpression=subexpression_number
94- -name_subexpression=subexpression_number
85+ -owner="app"
86+ -regex_expression="pattern"
87+ -type_mapping="matched_string=TYPE[/matched_string=TYPE]*"
88+ -owner_subexpression=subexpression_number
89+ -type_subexpression=subexpression_number
90+ -name_subexpression=subexpression_number
91+
9592-test_path=test - path to project test files, use the following options to enable custom type mappings:
96- -owner="app"
97- -regex_expression="pattern"
98- -type_mapping="matched_string=TYPE[/matched_string=TYPE]*"
99- -owner_subexpression=subexpression_number
100- -type_subexpression=subexpression_number
101- -name_subexpression=subexpression_number
93+ -owner="app"
94+ -regex_expression="pattern"
95+ -type_mapping="matched_string=TYPE[/matched_string=TYPE]*"
96+ -owner_subexpression=subexpression_number
97+ -type_subexpression=subexpression_number
98+ -name_subexpression=subexpression_number
99+
102100-c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards.
103101 Works only on reporeters that support colors (ut_documentation_reporter).
102+
104103--failure-exit-code - Override the exit code on failure, defaults to 1. You can set it to 0 to always exit with a success status.
104+
105105-scc - If specified, skips the compatibility-check with the version of the database framework.
106106 If you skip compatibility-check, CLI will expect the most actual framework version
107- -include=package_list - Comma-separated object list to include in the coverage report.
108- Format: [schema.]package[,[schema.]package ...].
109- See coverage reporting options in framework documentation.
110- -exclude=package_list - Comma-separated object list to exclude from the coverage report.
111- Format: [schema.]package[,[schema.]package ...].
112- See coverage reporting options in framework documentation.
107+
108+ -include=pckg_list - Comma-separated object list to include in the coverage report.
109+ Format: [schema.]package[,[schema.]package ...].
110+ See coverage reporting options in framework documentation.
111+
112+ -exclude=pckg_list - Comma-separated object list to exclude from the coverage report.
113+ Format: [schema.]package[,[schema.]package ...].
114+ See coverage reporting options in framework documentation.
113115```
114116
115117Parameters -f, -o, -s are correlated. That is parameters -o and -s are controlling outputs for reporter specified by the preceding -f parameter.
116118
117119Sonar and Coveralls reporter will only provide valid reports, when source_path and/or test_path are provided, and ut_run is executed from your project's root path.
118120
119- Examples:
121+ #### Examples
120122
121123```
122- utplsql run hr/hr@xe -p=hr_test -f=ut_documentation_reporter -o=run.log -s -f=ut_coverage_html_reporter -o=coverage.html -source_path=source
124+ > utplsql run hr/hr@xe -p=hr_test -f=ut_documentation_reporter -o=run.log -s -f=ut_coverage_html_reporter -o=coverage.html -source_path=source
123125```
124126
125127Invokes all Unit tests from schema/package "hr_test" with two reporters:
@@ -128,12 +130,87 @@ Invokes all Unit tests from schema/package "hr_test" with two reporters:
128130* ut_coverage_html_reporter - will report only on database objects that are mapping to file structure from "source" folder and save output to file "coverage.html"
129131
130132```
131- utplsql run hr/hr@xe
133+ > utplsql run hr/hr@xe
132134```
133135
134136Invokes all unit test suites from schema "hr". Results are displayed to screen using default ut_documentation_reporter.
135137
136- #### Enabling Color Outputs on Windows
138+ ### info
139+ ` utplsql info [<ConnectionURL>] `
140+
141+
142+ #### Examples
143+
144+ ```
145+ > utplsql info
146+
147+ cli 3.1.1-SNAPSHOT.local
148+ utPLSQL-java-api 3.1.1-SNAPSHOT.123
149+ ```
150+ ```
151+ > utplsql info app/app@localhost:1521/ORCLPDB1
152+
153+ cli 3.1.1-SNAPSHOT.local
154+ utPLSQL-java-api 3.1.1-SNAPSHOT.123
155+ utPLSQL 3.1.2.1913
156+ ```
157+
158+ ### reporters
159+ ` utplsql reporters <ConnectionURL> `
160+
161+ #### Examples
162+ ```
163+ > utplsql reporters app/app@localhost:1521/ORCLPDB1
164+
165+ UT_COVERAGE_COBERTURA_REPORTER:
166+ Generates a Cobertura coverage report providing information on code coverage with line numbers.
167+ Designed for Jenkins and TFS to report coverage.
168+ Cobertura Document Type Definition can be found: http://cobertura.sourceforge.net/xml/coverage-04.dtd.
169+ Sample file: https://github.com/leobalter/testing-examples/blob/master/solutions/3/report/cobertura-coverage.xml.
170+
171+ UT_COVERAGE_HTML_REPORTER:
172+ Generates a HTML coverage report with summary and line by line information on code coverage.
173+ Based on open-source simplecov-html coverage reporter for Ruby.
174+ Includes source code in the report.
175+ Will copy all necessary assets to a folder named after the Output-File
176+
177+ UT_COVERAGE_SONAR_REPORTER:
178+ Generates a JSON coverage report providing information on code coverage with line numbers.
179+ Designed for [SonarQube](https://about.sonarqube.com/) to report coverage.
180+ JSON format returned conforms with the Sonar specification: https://docs.sonarqube.org/display/SONAR/Generic+Test+Data
181+
182+ UT_COVERALLS_REPORTER:
183+ Generates a JSON coverage report providing information on code coverage with line numbers.
184+ Designed for [Coveralls](https://coveralls.io/).
185+ JSON format conforms with specification: https://docs.coveralls.io/api-introduction
186+
187+ UT_DOCUMENTATION_REPORTER:
188+ A textual pretty-print of unit test results (usually use for console output)
189+ Provides additional properties lvl and failed
190+
191+ UT_JUNIT_REPORTER:
192+ Provides outcomes in a format conforming with JUnit 4 and above as defined in: https://gist.github.com/kuzuha/232902acab1344d6b578
193+
194+ UT_SONAR_TEST_REPORTER:
195+ Generates a JSON report providing detailed information on test execution.
196+ Designed for [SonarQube](https://about.sonarqube.com/) to report test execution.
197+ JSON format returned conforms with the Sonar specification: https://docs.sonarqube.org/display/SONAR/Generic+Test+Data
198+
199+ UT_TEAMCITY_REPORTER:
200+ Provides the TeamCity (a CI server by jetbrains) reporting-format that allows tracking of progress of a CI step/task as it executes.
201+ https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity
202+
203+ UT_TFS_JUNIT_REPORTER:
204+ Provides outcomes in a format conforming with JUnit version for TFS / VSTS.
205+ As defined by specs :https://docs.microsoft.com/en-us/vsts/build-release/tasks/test/publish-test-results?view=vsts
206+ Version is based on windy road junit https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd.
207+
208+ UT_XUNIT_REPORTER:
209+ Depracated reporter. Please use Junit.
210+ Provides outcomes in a format conforming with JUnit 4 and above as defined in: https://gist.github.com/kuzuha/232902acab1344d6b578
211+ ```
212+
213+ ## Enabling Color Outputs on Windows
137214
138215To enable color outputs on Windows cmd you need to install an open-source utility called [ ANSICON] ( http://adoxa.altervista.org/ansicon/ ) .
139216
@@ -143,4 +220,4 @@ Since v3.1.0 you can call custom reporters (PL/SQL) via cli, too. Just call the
143220
144221```
145222utplsql run hr/hr@xe -p=hr_test -f=my_custom_reporter -o=run.log -s
146- ```
223+ ```
0 commit comments