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
+41-25Lines changed: 41 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1225,11 +1225,11 @@ Finished in .035261 seconds
1225
1225
1226
1226
### Tags
1227
1227
1228
-
Tag is a label attached to the test or a suite path. It is used for identification and execution a group of tests / suites that share same tag.
1228
+
Tag is a label attached to the test or a suite. It is used for identification and execution a group of tests / suites that share same tag.
1229
1229
1230
-
It allows us to group a tests / suites using a various categorization and place a test / suite in multiple buckets. Same tests can be group with other tests based on the functionality , frequency, type of output etc.
1230
+
It allows for grouping of tests / suites using various categorization and place tests / suites in multiple buckets. Same tests can be grouped with other tests based on the functionality , frequency, type of output etc.
1231
1231
1232
-
e.q.
1232
+
e.g.
1233
1233
1234
1234
```sql
1235
1235
--%tags(batch,daily,csv)
@@ -1238,29 +1238,31 @@ e.q.
1238
1238
or
1239
1239
1240
1240
```sql
1241
-
--%tags(api,online,json)
1241
+
--%tags(online,json)
1242
+
--%tags(api)
1242
1243
```
1243
1244
1245
+
Tags are defined as a comma separated list within the `--%tags` annotation.
1244
1246
1247
+
When executing a test run with tag filter applied, framework will find all tests associated with given tags and execute them.
1248
+
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.
1245
1249
1246
-
Tags are defined as a coma separated list. When executing a test run with tag filter applied, framework will find all tests associated with given tags and execute them. Framework applies `OR` logic when resolving a tags so any tests / suites that match at least one tag will be included in the test run.
1250
+
When a suite/context is tagged all of its children will automatically inherit a tag and get executed along with the parent. Parent suite tests are not executed, but a suitepath hierarchy is kept.
1247
1251
1248
-
When a suite gets tagged all of its children will automatically inherit a tag and get executed along the parent. Parent suit tests are not executed. but a suitepath hierarchy is kept.
1249
-
1250
-
Sample tag package.
1251
1252
1253
+
Sample test suite package with tags.
1252
1254
```sql
1253
1255
create or replace package ut_sample_test IS
1254
1256
1255
1257
--%suite(Sample Test Suite)
1256
-
--%tag(suite1)
1258
+
--%tags(api)
1257
1259
1258
1260
--%test(Compare Ref Cursors)
1259
-
--%tag(test1,sample)
1261
+
--%tags(complex,fast)
1260
1262
procedure ut_refcursors1;
1261
1263
1262
1264
--%test(Run equality test)
1263
-
--%tag(test2,sample)
1265
+
--%tags(simple,fast)
1264
1266
procedure ut_test;
1265
1267
1266
1268
end ut_sample_test;
@@ -1290,28 +1292,42 @@ end ut_sample_test;
1290
1292
Execution of the test is done by using a parameter `a_tags`
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`
1320
+
Given the above example package `ut_sample_test`, only `ut_sample_test.ut_test` will be executed.
1308
1321
1309
-
- tags are case sensitive
1310
-
- tags cannot be an empty string
1311
-
- tags cannot contain spaces e.g. to create a multi-word `tag` please use underscores,dashes, dots etc. e.g. `test_of_batch`
1312
-
- tags with empty spaces will be ignored during execution
1313
-
- tags can contain special characters
1322
+
**Note:**
1323
+
Tags must follow the below naming convention:
1314
1324
1325
+
- tag is case sensitive
1326
+
- tag can contain special characters like `$#/\?-!` etc.
1327
+
- tag cannot be an empty string
1328
+
- tag cannot start with a dash e.g. `-some-stuff` is **not** a valid tag
1329
+
- 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`
1330
+
- leading and trailing spaces are ignored in tag name e.g. `--%tags( tag1 , tag2 )` becomes `tag1` and `tag2` tag names
0 commit comments