Skip to content

Commit 349cc53

Browse files
committed
Change the failure error code parameter
1 parent b0a8143 commit 349cc53

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

README.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,49 @@ You can download development versions on [Bintray](https://bintray.com/viniciusa
2020
utplsql run user/pass@[[host][:port]/]db [-p=(ut_path|ut_paths)] [-f=format [-o=output_file] [-s] ...]
2121

2222
```
23-
user - Username to connect as.
24-
password - Password of the user.
25-
host - Server address, defaults to 127.0.0.1.
26-
port - Server port, defaults to 1521.
27-
db - Database to connect to.
28-
-p=suite_path(s) - A suite path or a comma separated list of suite paths for unit test to be executed.
29-
The path(s) can be in one of the following formats:
30-
schema[.package[.procedure]]
31-
schema:suite[.suite[.suite][...]][.procedure]
32-
Both formats can be mixed in the list.
33-
If only schema is provided, then all suites owner by that schema are executed.
34-
If -p is omitted, the current schema is used.
35-
-f=format - A reporter to be used for reporting.
36-
If no -f option is provided, the default ut_documentation_reporter is used.
37-
Available options:
38-
-f=ut_documentation_reporter
39-
A textual pretty-print of unit test results (usually use for console output)
40-
-f=ut_teamcity_reporter
41-
For reporting live progress of test execution with Teamcity CI.
42-
-f=ut_xunit_reporter
43-
Used for reporting test results with CI servers like Jenkins/Hudson/Teamcity.
44-
-f=ut_coverage_html_reporter
45-
Generates a HTML coverage report with summary and line by line information on code coverage.
46-
Based on open-source simplecov-html coverage reporter for Ruby.
47-
Includes source code in the report.
48-
-f=ut_coveralls_reporter
49-
Generates a JSON coverage report providing information on code coverage with line numbers.
50-
Designed for [Coveralls](https://coveralls.io/).
51-
-f=ut_coverage_sonar_reporter
52-
Generates a JSON coverage report providing information on code coverage with line numbers.
53-
Designed for [SonarQube](https://about.sonarqube.com/) to report coverage.
54-
-f=ut_sonar_test_reporter
55-
Generates a JSON report providing detailed information on test execution.
56-
Designed for [SonarQube](https://about.sonarqube.com/) to report test execution.
57-
58-
-o=output - Defines file name to save the output from the specified reporter.
59-
If defined, the output is not displayed on screen by default. This can be changed with the -s parameter.
60-
If not defined, then output will be displayed on screen, even if the parameter -s is not specified.
61-
If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration.
62-
-s - Forces putting output to to screen for a given -f parameter.
63-
-c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards.
64-
Works only on reporeters that support colors (ut_documentation_reporter).
65-
--no-failure - By default, the client will exit with -1 if any test failed, override this behavior by providing this option.
23+
user - Username to connect as.
24+
password - Password of the user.
25+
host - Server address, defaults to 127.0.0.1.
26+
port - Server port, defaults to 1521.
27+
db - Database to connect to.
28+
-p=suite_path(s) - A suite path or a comma separated list of suite paths for unit test to be executed.
29+
The path(s) can be in one of the following formats:
30+
schema[.package[.procedure]]
31+
schema:suite[.suite[.suite][...]][.procedure]
32+
Both formats can be mixed in the list.
33+
If only schema is provided, then all suites owner by that schema are executed.
34+
If -p is omitted, the current schema is used.
35+
-f=format - A reporter to be used for reporting.
36+
If no -f option is provided, the default ut_documentation_reporter is used.
37+
Available options:
38+
-f=ut_documentation_reporter
39+
A textual pretty-print of unit test results (usually use for console output)
40+
-f=ut_teamcity_reporter
41+
For reporting live progress of test execution with Teamcity CI.
42+
-f=ut_xunit_reporter
43+
Used for reporting test results with CI servers like Jenkins/Hudson/Teamcity.
44+
-f=ut_coverage_html_reporter
45+
Generates a HTML coverage report with summary and line by line information on code coverage.
46+
Based on open-source simplecov-html coverage reporter for Ruby.
47+
Includes source code in the report.
48+
-f=ut_coveralls_reporter
49+
Generates a JSON coverage report providing information on code coverage with line numbers.
50+
Designed for [Coveralls](https://coveralls.io/).
51+
-f=ut_coverage_sonar_reporter
52+
Generates a JSON coverage report providing information on code coverage with line numbers.
53+
Designed for [SonarQube](https://about.sonarqube.com/) to report coverage.
54+
-f=ut_sonar_test_reporter
55+
Generates a JSON report providing detailed information on test execution.
56+
Designed for [SonarQube](https://about.sonarqube.com/) to report test execution.
57+
58+
-o=output - Defines file name to save the output from the specified reporter.
59+
If defined, the output is not displayed on screen by default. This can be changed with the -s parameter.
60+
If not defined, then output will be displayed on screen, even if the parameter -s is not specified.
61+
If more than one -o parameter is specified for one -f parameter, the last one is taken into consideration.
62+
-s - Forces putting output to to screen for a given -f parameter.
63+
-c - If specified, enables printing of test results in colors as defined by ANSICONSOLE standards.
64+
Works only on reporeters that support colors (ut_documentation_reporter).
65+
--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.
6666
```
6767

6868
Parameters -f, -o, -s are correlated. That is parameters -o and -s are controlling outputs for reporter specified by the preceding -f parameter.

src/main/java/io/github/utplsql/cli/RunCommand.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public class RunCommand {
5353
private boolean colorConsole = false;
5454

5555
@Parameter(
56-
names = {"--no-failure"},
57-
description = "will exit with 0 even if tests failed, default false")
58-
private boolean noFailure = false;
56+
names = {"--failure-exit-code"},
57+
description = "override the exit code on failure, default = 1")
58+
private int failureExitCode = 1;
5959

6060
@Parameter(names = {"-source_path"}, description = "path to project source files")
6161
private String sourcePath;
@@ -145,10 +145,10 @@ public int run() throws Exception {
145145
.withSourceFiles(sourceFiles)
146146
.withTestFiles(testFiles)
147147
.colorConsole(this.colorConsole)
148-
.failOnErrors(!this.noFailure)
148+
.failOnErrors(true)
149149
.run(conn);
150150
} catch (SomeTestsFailedException e) {
151-
returnCode[0] = -1;
151+
returnCode[0] = this.failureExitCode;
152152
} catch (SQLException e) {
153153
// TODO
154154
e.printStackTrace();

0 commit comments

Comments
 (0)