Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
133ecae
Adding new API user.
lwasylow Mar 22, 2019
9db8f4b
Separating tests.
lwasylow Mar 23, 2019
13f772a
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Mar 24, 2019
c56943e
Update properties
lwasylow Mar 24, 2019
5afba10
Change user that executes tests as helper that is super user.
lwasylow Mar 24, 2019
7cd92e7
Adding next set of tests migrated.
lwasylow Mar 24, 2019
e2561bc
Adding next set of tests migrated.
lwasylow Mar 25, 2019
887e46a
Fixing test package
lwasylow Mar 25, 2019
28dbd1e
Added set of tests:
lwasylow Mar 25, 2019
d7eb125
Adding set of tests :
lwasylow Mar 25, 2019
99e1099
Adding schema prefix to failing tests from 12.1
lwasylow Mar 25, 2019
04cd36c
Fixing development scripts
lwasylow Mar 25, 2019
3e98723
Fixed bug for deployments with uninstall included.
jgebal Mar 25, 2019
ba83f8f
Merge branch 'feature/introduce_testing_with_accurate_grants' of gith…
lwasylow Mar 26, 2019
0bf1d9e
FIX : removal of non existing types from uninstall script
lwasylow Mar 26, 2019
e914d96
INSTALL:Is it too many monkeys ?:)
lwasylow Mar 26, 2019
174dcbc
Adding set of tests:
lwasylow Mar 26, 2019
0c05daf
Adding set of tests:
lwasylow Mar 26, 2019
80783c3
Adding set of tests:
lwasylow Mar 28, 2019
c4b08af
Adding set of tests:
lwasylow Mar 28, 2019
0618616
Adding set of tests:
lwasylow Mar 28, 2019
29295b7
Adding set of tests:
lwasylow Mar 29, 2019
30b0cfe
Adding set of tests:
lwasylow Mar 29, 2019
3cc34ea
Adding tests
lwasylow Mar 29, 2019
a6a848d
Adding tests:
lwasylow Mar 30, 2019
858372c
Adding set of tests:
lwasylow Mar 31, 2019
620fd61
Adding extra tests:
lwasylow Mar 31, 2019
e6b0673
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Mar 31, 2019
c508e79
Adding tests:
lwasylow Apr 1, 2019
858a675
Fixing broken test.
lwasylow Apr 1, 2019
1642f47
Adding test:
lwasylow Apr 1, 2019
30d27fe
Adding global setup
lwasylow Apr 1, 2019
3b07c6a
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Apr 2, 2019
a8dfa14
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Apr 2, 2019
5d3b18c
Update cleanup script after branching from random order branch
lwasylow Apr 2, 2019
b56d27a
Fixed invalid suitepath in `core` package.
jgebal Apr 3, 2019
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
Prev Previous commit
Next Next commit
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
…roduce_testing_with_accurate_grants
  • Loading branch information
lwasylow committed Apr 2, 2019
commit 3b07c6ae004cca1caaf89a6003e59662a9dad847
2 changes: 1 addition & 1 deletion docs/about/authors.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

### utPLSQL v3 Major Contributors

Expand Down
2 changes: 1 addition & 1 deletion docs/about/license.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Version Information

Expand Down
2 changes: 1 addition & 1 deletion docs/about/project-details.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# utPLSQL Project Details

Expand Down
2 changes: 1 addition & 1 deletion docs/about/support.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# How to get support

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Introduction to utPLSQL

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/advanced_data_comparison.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Advanced data comparison

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/annotations.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Annotations

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/best-practices.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Best Practices

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/coverage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Coverage
utPLSQL comes with a built-in coverage reporting engine. The code coverage reporting is based on the DBMS_PROFILER package provided with Oracle database.
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/exception-reporting.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Exception handling and reporting

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/expectations.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Expectation concepts
Validation of the code under test (the tested logic of procedure/function etc.) is performed by comparing the actual data against the expected data.
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Getting started with TDD and utPLSQL

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/install.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Downloading latest version of utPLSQL

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/querying_suites.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Qyerying for test suites

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/reporters.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

utPLSQL provides the following reporting formats.

Expand Down
113 changes: 91 additions & 22 deletions docs/userguide/running-unit-tests.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Running tests

Expand Down Expand Up @@ -47,6 +47,7 @@ The examples below illustrate different ways and options to invoke `ut.run` proc

```sql
alter session set current_schema=hr;
set serveroutput on
begin
ut.run();
end;
Expand All @@ -55,6 +56,7 @@ Executes all tests in current schema (_HR_).


```sql
set serveroutput on
begin
ut.run('HR');
end;
Expand All @@ -63,6 +65,7 @@ Executes all tests in specified schema (_HR_).


```sql
set serveroutput on
begin
ut.run('hr:com.my_org.my_project');
end;
Expand All @@ -73,6 +76,7 @@ Check the [annotations documentation](annotations.md) to find out about suitepat


```sql
set serveroutput on
begin
ut.run('hr.test_apply_bonus');
end;
Expand All @@ -81,6 +85,7 @@ Executes all tests from package _hr.test_apply_bonus_.


```sql
set serveroutput on
begin
ut.run('hr.test_apply_bonus.bonus_cannot_be_negative');
end;
Expand All @@ -89,13 +94,15 @@ Executes single test procedure _hr.test_apply_bonus.bonus_cannot_be_negative_.


```sql
set serveroutput on
begin
ut.run(ut_varchar2_list('hr.test_apply_bonus','cust'));
end;
```
Executes all tests from package _hr.test_apply_bonus_ and all tests from schema _cust_.

```sql
set serveroutput on
begin
ut.run(ut_varchar2_list('hr.test_apply_bonus,cust)');
end;
Expand All @@ -104,6 +111,7 @@ end;
Executes all tests from package _hr.test_apply_bonus_ and all tests from schema _cust_.

```sql
set serveroutput on
begin
ut.run('hr.test_apply_bonus,cust');
end;
Expand All @@ -124,6 +132,7 @@ The `ut.run` procedures and functions accept `a_reporter` attribute that defines
You can execute any set of tests with any of the predefined reporters.

```sql
set serveroutput on
begin
ut.run('hr.test_apply_bonus', ut_junit_reporter());
end;
Expand All @@ -133,33 +142,17 @@ Executes all tests from package _HR.TEST_APPLY_BONUS_ and provide outputs to DBM

For details on build-in reporters look at [reporters documentation](reporters.md).

## Keeping uncommited data after test-run

utPLSQL by default runs tests in autonomous transaction and performs automatic rollback to assure that tests do not impact one-another and do not have impact on the current session in your IDE.

If you would like to keep your uncommited data persisted after running tests, you can do so by using `a_force_manual_rollback` flag.
Setting this flag to true has following side-effects:

- test execution is done in current transaction - if while running tests commit or rollback is issued your current session data will get commited too.
- automatic rollback is forced to be disabled in test-run even if it was explicitly enabled by using annotation `--%rollback(manual)

Example invocation:
```sql
begin
ut.run('hr.test_apply_bonus', a_force_manual_rollback => true);
end;
```


This option is not anvailable when running tests using `ut.run` as a table function.

## ut.run functions

The `ut.run` functions provide exactly the same functionality as the `ut.run` procedures.
You may use the same sets of parameters with both functions and procedures.
The only difference is the output of the results.
Functions provide output as a pipelined stream and therefore need to be executed as select statements.

**Note:**
>When running tests with `ut.run` functions, whole test run is executed as autonomous transaction.
At the end of the run, the transaction is automatically rolled-back and all uncommitted changes are reverted.

Example.
```sql
select * from table(ut.run('hr.test_apply_bonus', ut_junit_reporter()));
Expand All @@ -180,7 +173,83 @@ 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
# Order of test execution

## Default order

When unit tests are executed without random order, they are ordered by:
- schema name
- suite path or test package name if `--%suitepath` was not specified for that package
- `--%test` line number in package

## Random order

You can force a test run to execute tests in random order by providing one of options to `ut.run`:
- `a_random_test_order` - true/false for procedures and 1/0 for functions
- `a_random_test_order_seed` - positive number in range of 1 .. 1 000 000 000

When tests are executed with random order, randomization is applied to single level of suitepath hierarchy tree.
This is needed to maintain visibility and accessibility of common setup/cleanup `beforeall`/`afterall` in tests.

Example:
```sql
set serveroutput on
begin
ut.run('hr.test_apply_bonus', a_random_test_order => true);
end;
```

```sql
select * from table(ut.run('hr.test_apply_bonus', a_random_test_order => 1));
```

When running with random order, the default report (`ut_documentation_reporter`) will include information about the random test run seed.
Example output:
```
...
Finished in .12982 seconds
35 tests, 0 failed, 0 errored, 1 disabled, 0 warning(s)
Tests were executed with random order seed '302980531'.
```

If you want to re-run tests using previously generated seed, you may do so by running them with parameter `a_random_test_order_seed`
Example:
```sql
set serveroutput on
begin
ut.run('hr.test_apply_bonus', a_random_test_order_seed => 302980531);
end;
```

```sql
select * from table(ut.run('hr.test_apply_bonus', a_random_test_order_seed => 302980531));
```

**Note**
>Random order seed must be a positive number within range of 1 .. 1 000 000 000.

# Keeping uncommitted data after test-run

utPLSQL by default runs tests in autonomous transaction and performs automatic rollback to assure that tests do not impact one-another and do not have impact on the current session in your IDE.

If you would like to keep your uncommitted data persisted after running tests, you can do so by using `a_force_manual_rollback` flag.
Setting this flag to true has following side-effects:

- test execution is done in current transaction - if while running tests commit or rollback is issued your current session data will get commited too.
- automatic rollback is forced to be disabled in test-run even if it was explicitly enabled by using annotation `--%rollback(manual)

Example invocation:
```sql
set serveroutput on
begin
ut.run('hr.test_apply_bonus', a_force_manual_rollback => true);
end;
```

**Note:**
>This option is not available when running tests using `ut.run` as a table function.

# Reports character-set 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.

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/upgrade.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.7.2748--develop-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.7.2795--develop-blue.svg)

# Upgrading from version 2

Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.