You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/userguide/annotations.md
+1-81Lines changed: 1 addition & 81 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1616,7 +1616,7 @@ or
1616
1616
1617
1617
Tags are defined as a comma separated list within the `--%tags` annotation.
1618
1618
1619
-
When a suite/context is tagged, all of its children will automatically inherit the tag and get executed along with the parent, unless they are excluded by tag expression.
1619
+
When a suite/context is tagged, all of its children will automatically inherit the tag and get executed along with the parent, unless they are excluded explicitly at runtime with a negated tag expression.
1620
1620
Parent suite tests are not executed, but a suitepath hierarchy is kept.
1621
1621
1622
1622
Sample test suite package with tags.
@@ -1657,52 +1657,6 @@ create or replace package body ut_sample_test is
1657
1657
end ut_sample_test;
1658
1658
/
1659
1659
```
1660
-
1661
-
#### Tag Expressions
1662
-
1663
-
Tag expressions are boolean expressions with the operators !, & and |. In addition, ( and ) can be used to adjust for operator precedence.
1664
-
1665
-
| Operator | Meaning |
1666
-
| -------- | --------|
1667
-
| ! | not |
1668
-
| & | and |
1669
-
|\|| or |
1670
-
1671
-
If you are tagging your tests across multiple dimensions, tag expressions help you to select which tests to execute. When tagging by test type (e.g., micro, integration, end-to-end) and feature (e.g., product, catalog, shipping), the following tag expressions can be useful.
1672
-
1673
-
1674
-
| Tag Expression | Selection |
1675
-
| -------- | --------|
1676
-
| product | all tests for product |
1677
-
| catalog \| shipping | all tests for catalog plus all tests for shipping |
1678
-
| catalog & shipping | all tests for the intersection between catalog and shipping |
1679
-
| product & !end-to-end | all tests for product, but not the end-to-end tests |
1680
-
| (micro \| integration) & (product \| shipping) | all micro or integration tests for product or shipping |
1681
-
1682
-
1683
-
Execution of the test is done by using the parameter `a_tags` with tag expressions
The above call will execute all tests from `ut_sample_test` package as the whole suite is tagged with `api`
1695
-
1696
-
```sql linenums="1"
1697
-
select*from table(ut.run(a_tags =>'complex'));
1698
-
```
1699
-
The above call will execute only the `ut_sample_test.ut_refcursors1` test, as only the test `ut_refcursors1` is tagged with `complex`
1700
-
1701
-
```sql linenums="1"
1702
-
select*from table(ut.run(a_tags =>'fast'));
1703
-
```
1704
-
The above call will execute both `ut_sample_test.ut_refcursors1` and `ut_sample_test.ut_test` tests, as both tests are tagged with `fast`
1705
-
1706
1660
#### Tag naming convention
1707
1661
1708
1662
Tags must follow the below naming convention:
@@ -1715,45 +1669,11 @@ Tags must follow the below naming convention:
1715
1669
- vertical bar (|)
1716
1670
- exclamation point (!)
1717
1671
- tag cannot be null or blank
1718
-
- tag cannot contain whitespace
1719
1672
- tag cannot start with a dash, e.g. `-some-stuff` is **not** a valid tag
1720
1673
- tag cannot contain spaces, e.g. `test of batch`. To create a multi-word tag use underscores or dashes, e.g. `test_of_batch`, `test-of-batch`
1721
1674
- leading and trailing spaces are ignored in tag name, e.g. `--%tags( tag1 , tag2 )` becomes `tag1` and `tag2` tag names
1722
1675
1723
1676
1724
-
#### Excluding tests/suites by tags
1725
-
1726
-
It is possible to exclude parts of test suites with tags.
1727
-
In order to do so, prefix the tag name to exclude with a `!` (exclamation) sign when invoking the test run which is equivalent of `-` (dash) in legacy notation.
The above call will execute all suites/contexts/tests that are marked with any of tags `api` or `fast` except those suites/contexts/tests that are marked as `complex`.
1753
-
Given the above example package `ut_sample_test`, only `ut_sample_test.ut_test` will be executed.
1754
-
1755
-
1756
-
1757
1677
### Suitepath
1758
1678
1759
1679
It is very likely that the application for which you are going to introduce tests consists of many different packages, procedures and functions.
In addition to the path, you can filter the tests to be run by specifying tags. Tags are defined in the test / context / suite with the `--%tags`-annotation ([Read more](annotations.md#tags)).
321
321
Multiple tags are separated by comma.
322
-
The framework applies `OR` logic to all specified tags so any test / suite that matches at least one tag will be included in the test run.
322
+
323
+
324
+
### Tag Expressions
325
+
326
+
Tag expressions are boolean expressions with the operators !, & and |. In addition, ( and ) can be used to adjust for operator precedence.
327
+
328
+
| Operator | Meaning |
329
+
| -------- | --------|
330
+
| ! | not |
331
+
| & | and |
332
+
|\|| or |
333
+
334
+
If you are tagging your tests across multiple dimensions, tag expressions help you to select which tests to execute. When tagging by test type (e.g., micro, integration, end-to-end) and feature (e.g., product, catalog, shipping), the following tag expressions can be useful.
335
+
336
+
337
+
| Tag Expression | Selection |
338
+
| -------- | --------|
339
+
| product | all tests for product |
340
+
| catalog \| shipping | all tests for catalog plus all tests for shipping |
341
+
| catalog & shipping | all tests for the intersection between catalog and shipping |
342
+
| product & !end-to-end | all tests for product, but not the end-to-end tests |
343
+
| (micro \| integration) & (product \| shipping) | all micro or integration tests for product or shipping |
344
+
345
+
346
+
Execution of the test is done by using the parameter `a_tags` with tag expressions
The above call will execute both `ut_sample_test.ut_refcursors1` and `ut_sample_test.ut_test` tests, as both tests are tagged with `fast`
368
+
369
+
### Excluding tests/suites by tags
332
370
333
-
You can also exclude specific tags by adding a `-` (dash) in front of the tag
371
+
It is possible to exclude parts of test suites with tags.
372
+
In order to do so, prefix the tag name to exclude with a `!` (exclamation) sign when invoking the test run which is equivalent of `-` (dash) in legacy notation.
The above call will execute all suites/contexts/tests that are marked with any of tags `api` or `fast` except those suites/contexts/tests that are marked as `complex`.
398
+
Given the above example package `ut_sample_test`, only `ut_sample_test.ut_test` will be executed.
399
+
400
+
339
401
## Keeping uncommitted data after test-run
340
402
341
403
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.
0 commit comments