|
1 | | -#Unit Test reporters |
2 | | -TODO |
| 1 | +utPLSQL provides the following reporting formats. |
| 2 | + |
| 3 | +#Documentation reporter |
| 4 | + |
| 5 | +The `ut_documentation_reporter` is the default reporting format used by the framework. |
| 6 | +It provides a human readable test results. |
| 7 | + |
| 8 | +To invoke tests with documentation reporter use one of following calls from sql console (SQLPlus) |
| 9 | + |
| 10 | +`exec ut.run();` |
| 11 | + |
| 12 | +`exec ut.run(ut_documentation_reporter());` |
| 13 | + |
| 14 | +You may also invoke unit tests directly from command line by calling. |
| 15 | + |
| 16 | +`sqlplus /nolog @ut_run %user%/%pass%@%dbsid%` |
| 17 | + |
| 18 | +Invoking tests from command line tool `ut_run.sql` allows you to track progress of test execution. |
| 19 | +In that case, the documentation reporter will provide information about each test that was executed as soon as it's execution finishes. |
| 20 | +For more details on using the `ut_run.sql` script look into [ut_run.sql](ut_run-script.md) documentation. |
| 21 | + |
| 22 | +The `ut_documentation_reporter` doesn't accept any arguments. |
| 23 | + |
| 24 | +Example outputs from documentation reporter. |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +The documentation report provides the following information. |
| 29 | +- Test suite name or test package name (nested with suitepath if suitepath is used) |
| 30 | +- Test description name or test procedure name |
| 31 | +- Information about test failing `(FAILED - n)` |
| 32 | +- Information about disabled test `(IGNORED)` |
| 33 | +- List of all errors and failures |
| 34 | +- Summary with total number of tests, number of tests with status and timing for the execution |
| 35 | + |
| 36 | + |
| 37 | +##Color output from documentation reporter |
| 38 | + |
| 39 | +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. |
| 40 | + |
| 41 | +To invoke tests with documentation reporter in color mode use one of following calls. |
| 42 | + |
| 43 | +`exec ut.run(a_color_console=>true);` |
| 44 | + |
| 45 | +`exec ut.run(ut_documentation_reporter(), a_color_console=>true);` |
| 46 | + |
| 47 | +Example outputs from documentation reporter. |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +#XUnit reporter |
| 53 | + |
| 54 | +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. |
| 55 | +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). |
| 56 | + |
| 57 | +Invocation of tests with XUnit reporter. |
| 58 | + |
| 59 | +`exec ut.run(ut_xunit_reporter());` |
| 60 | + |
| 61 | +The `ut_xunit_reporter` doesn't accept any arguments. |
| 62 | + |
| 63 | +Example of xunit report integrated with [Jenkins CI](https://jenkins.io/) |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +Example of failure report details |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +#Teamcity reporter |
| 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`. |
| 76 | + |
| 77 | +Invocation of tests with Teamcity reporter. |
| 78 | + |
| 79 | +`exec ut.run(ut_teamcity_reporter());` |
| 80 | + |
| 81 | +The `ut_teamcity_reporter` doesn't accept any arguments. |
| 82 | + |
| 83 | +Example of unit test report from Teamcity CI server. |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +Example of failure report details |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +# Coverage reporters |
| 93 | + |
| 94 | +utPLSQL comes with a set of build-in coverage reporters. Have a look into the [coverage documentation](coverage.md) to learn more about them. |
0 commit comments