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-39Lines changed: 1 addition & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1617,46 +1617,8 @@ or
1617
1617
Tags are defined as a comma separated list within the `--%tags` annotation.
1618
1618
1619
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
-
Parent suite tests are not executed, but a suitepath hierarchy is kept.
1620
+
See [running unit tests](running-unit-tests.md) for more information on using tags to filter test suites that are to be executed.
Copy file name to clipboardExpand all lines: docs/userguide/running-unit-tests.md
+68-22Lines changed: 68 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -323,7 +323,7 @@ Multiple tags are separated by comma.
323
323
324
324
### Tag Expressions
325
325
326
-
Tag expressions are boolean expressions with the operators !, & and |. In addition, ( and ) can be used to adjust for operator precedence.
326
+
Tag expressions are boolean expressions created by combining tags with the `!`, `&`, `|` operators. Tag expressions can be grouped using `(` and `)` braces. Grouping tag expressions affects operator precedence.
327
327
328
328
| Operator | Meaning |
329
329
| -------- | --------|
@@ -338,28 +338,86 @@ If you are tagging your tests across multiple dimensions, tag expressions help y
338
338
| -------- | --------|
339
339
| product | all tests for product |
340
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|
341
+
| catalog & shipping | all tests that are tagged with both `catalog` and `shipping` tags |
342
+
| product & !end-to-end | all tests tagged `product`, except the tests tagged `end-to-end`|
343
343
| (micro \| integration) & (product \| shipping) | all micro or integration tests for product or shipping |
344
344
345
345
346
-
Execution of the test is done by using the parameter `a_tags` with tag expressions
346
+
Taking the last expression above `(micro | integration) & (product | shipping)`
347
347
348
+
| --%tags |included in run |
349
+
| -------- | --------|
350
+
| micro | no |
351
+
| integration | no |
352
+
| micro | no |
353
+
| product | no |
354
+
| shipping | no |
355
+
| micro | no |
356
+
| micro, integration | no |
357
+
| product, shipping | no |
358
+
| micro, product | yes |
359
+
| micro, shipping | yes |
360
+
| integration, product | yes |
361
+
| integration, shipping | yes |
362
+
| integration, micro, shipping | yes |
363
+
| integration, micro, product | yes |
364
+
| integration, shipping ,product | yes |
365
+
| micro, shipping ,product | yes |
366
+
| integration, micro, shipping ,product | yes |
367
+
368
+
369
+
### Sample execution of test with tags.
370
+
371
+
Execution of the test with tag expressions is done using the parameter `a_tags`.
372
+
Given a test package `ut_sample_test` defined below
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`.
443
+
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` and except those suites/contexts/tests that are marked as `test1`.
398
444
Given the above example package `ut_sample_test`, only `ut_sample_test.ut_test` will be executed.
0 commit comments