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
+61-10Lines changed: 61 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1616,11 +1616,8 @@ or
1616
1616
1617
1617
Tags are defined as a comma separated list within the `--%tags` annotation.
1618
1618
1619
-
When executing a test run with tag filter applied, the framework will find all tests associated with the given tags and execute them.
1620
-
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.
1621
-
1622
-
When a suite/context is tagged, all of its children will automatically inherit the tag and get executed along with the parent. Parent suite tests are not executed, but a suitepath hierarchy is kept.
1623
-
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.
1620
+
Parent suite tests are not executed, but a suitepath hierarchy is kept.
1624
1621
1625
1622
Sample test suite package with tags.
1626
1623
```sql linenums="1"
@@ -1661,7 +1658,37 @@ end ut_sample_test;
1661
1658
/
1662
1659
```
1663
1660
1664
-
Execution of the test is done by using the parameter `a_tags`
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
+
Two special expressions are supported, any() and none(), which select all tests with any tags at all, and all tests without any tags, respectively. These special expressions may be combined with other expressions just like normal tags.
1666
+
1667
+
| Operator | Meaning |
1668
+
| -------- | --------|
1669
+
| ! | not |
1670
+
| & | and |
1671
+
|\|| or |
1672
+
1673
+
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.
1674
+
1675
+
1676
+
| Tag Expression | Selection |
1677
+
| -------- | --------|
1678
+
| product | all tests for product |
1679
+
| catalog \| shipping | all tests for catalog plus all tests for shipping |
1680
+
| catalog & shipping | all tests for the intersection between catalog and shipping |
1681
+
| product & !end-to-end | all tests for product, but not the end-to-end tests |
1682
+
| (micro \| integration) & (product \| shipping) | all micro or integration tests for product or shipping |
1683
+
1684
+
1685
+
Execution of the test is done by using the parameter `a_tags` with tag expressions
@@ -1683,8 +1710,14 @@ The above call will execute both `ut_sample_test.ut_refcursors1` and `ut_sample_
1683
1710
Tags must follow the below naming convention:
1684
1711
1685
1712
- tag is case sensitive
1686
-
- tag can contain special characters like `$#/\?-!` etc.
1687
-
- tag cannot be an empty string
1713
+
- tag must not contain any of the following reserved characters:
1714
+
- comma (,)
1715
+
- left or right parenthesis ((, ))
1716
+
- ampersand (&)
1717
+
- vertical bar (|)
1718
+
- exclamation point (!)
1719
+
- tag cannot be null or blank
1720
+
- tag cannot contain whitespace
1688
1721
- tag cannot start with a dash, e.g. `-some-stuff` is **not** a valid tag
1689
1722
- 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`
1690
1723
- leading and trailing spaces are ignored in tag name, e.g. `--%tags( tag1 , tag2 )` becomes `tag1` and `tag2` tag names
@@ -1693,13 +1726,31 @@ Tags must follow the below naming convention:
1693
1726
#### Excluding tests/suites by tags
1694
1727
1695
1728
It is possible to exclude parts of test suites with tags.
1696
-
In order to do so, prefix the tag name to exclude with a `-` (dash) sign when invoking the test run.
1697
-
1729
+
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`.
1704
1755
Given the above example package `ut_sample_test`, only `ut_sample_test.ut_test` will be executed.
0 commit comments