Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/userguide/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Example outputs from documentation reporter.
# JUnit reporter

Most of continuous integration servers (like Jenkins) are capable of consuming unit test execution results in [JUnit](https://en.wikipedia.org/wiki/JUnit) format.
The `ut_junit_reporter` in earlier version referred as ut_xunit_reporter is producing outcomes as JUnit-compatible XML unit test report, that can be used by CI servers to display their custom reports and provide metrics (like tests execution trends).
The `ut_junit_reporter` in earlier version referred as `ut_xunit_reporter` is producing outcomes as JUnit-compatible XML unit test report, that can be used by CI servers to display their custom reports and provide metrics (like tests execution trends).
Please note that in previous versions it was called ut_xunit_reporter and for backward compatibility that name still exists.

Invocation of tests with JUnit reporter.
Expand All @@ -63,7 +63,7 @@ Example of failure report details

# Teamcity reporter

[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.
[Teamcity](https://www.jetbrains.com/teamcity/) is a CI server by Jetbrains. It supports JUnit reporting and additionally has it's own format of reporting that allows tracking of progress of a CI step/task as it executes.
The TeamCity format developed by Jetbrains is supported by utPLSQL with `ut_teamcity_reporter`.

Invocation of tests with Teamcity reporter.
Expand All @@ -74,11 +74,11 @@ The `ut_teamcity_reporter` doesn't accept any arguments.

Example of unit test report from Teamcity CI server.

![xunit_reporter_outputs](../images/teamcity_report_example.png)
![junit_reporter_outputs](../images/teamcity_report_example.png)

Example of failure report details

![xunit_reporter_outputs](../images/teamcity_report_example_errors.png)
![junit_reporter_outputs_errors](../images/teamcity_report_example_errors.png)


# Sonar test reporter
Expand Down
20 changes: 17 additions & 3 deletions docs/userguide/running-unit-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ You can execute any set of tests with any of the predefined reporters.

```sql
begin
ut.run('hr.test_apply_bonus', ut_xunit_reporter());
ut.run('hr.test_apply_bonus', ut_junit_reporter());
end;
```
Executes all tests from package _HR.TEST_APPLY_BONUS_ and provide outputs to DBMS_OUTPUT using the XUnit reporter.
Executes all tests from package _HR.TEST_APPLY_BONUS_ and provide outputs to DBMS_OUTPUT using the JUnit reporter.


For details on build-in reporters look at [reporters documentation](reporters.md).
Expand All @@ -140,7 +140,7 @@ Functions provide output as a pipelined stream and therefore need to be executed

Example.
```sql
select * from table(ut.run('hr.test_apply_bonus', ut_xunit_reporter()));
select * from table(ut.run('hr.test_apply_bonus', ut_junit_reporter()));
```

# ut_runner.run procedures
Expand All @@ -158,3 +158,17 @@ The concept is pretty simple.
- as a separate thread, start `ut_runner.run` and pass reporters with previously defined output_ids.
- for each reporter start a separate thread and read outputs from the `ut_output_buffer.get_lines` table function by providing the output_id defined in the main thread.

# Reports characterset encoding

To get properly encoded reports, when running utPLSQL with HTML/XML reports on data containing national characters you need to provide your client character set when calling `ut.run` functions and procedures.

If you run your tests using `utPLSQL-cli`, this is done automatically and no action needs to be taken.

To make sure that the reports will display your national characters properly when running from IDE like SQLDeveloper/TOAD/SQLPlus or sqlcl you need to provide the charaterset manualy to `ut.run`.

Example call with characterset provided:
```sql
begin
ut.run('hr.test_apply_bonus', ut_junit_reporter(), a_client_character_set => 'Windows-1251');
end;
```