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
+73-4Lines changed: 73 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ We strongly recommend putting package level annotations at the very top of packa
38
38
|`--%disabled`| Package/procedure | Used to disable a suite or a test. Disabled suites/tests do not get executed, they are however marked and reported as disabled in a test run. |
39
39
|`--%context(<name>)`| Package | Denotes start of a named context (sub-suite) in a suite package |
40
40
|`--%endcontext`| Package | Denotes end of a nested context (sub-suite) in a suite package |
41
+
|`--%tags`| Package/procedure | Used to label a test or a suite for purpose of identification |
41
42
42
43
### Suite
43
44
@@ -823,7 +824,7 @@ See [beforeall](#Beforeall) for more examples.
823
824
Indicates specific setup procedure(s) to be executed for a test. The procedure(s) can be located either:
824
825
- within current package (package name is optional)
825
826
- within another package
826
-
827
+
827
828
The annotation need to be placed alongside `--%test` annotation.
828
829
829
830
The `--%beforetest` procedures are executed after invoking all `--%beforeeach` for a test.
@@ -911,7 +912,7 @@ Finished in .015185 seconds
911
912
Indicates specific cleanup procedure(s) to be executed for a test. The procedure(s) can be located either:
912
913
- within current package (package name is optional)
913
914
- within another package
914
-
915
+
915
916
The annotation need to be placed alongside `--%test` annotation.
916
917
917
918
If a test is marked as disabled the `--%aftertest` procedures are not invoked for that test.
@@ -1221,6 +1222,74 @@ Finished in .035261 seconds
1221
1222
```
1222
1223
1223
1224
1225
+
1226
+
### Tags
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.
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.
1231
+
1232
+
e.q.
1233
+
1234
+
```sql
1235
+
--%tags(batch,daily,csv)
1236
+
```
1237
+
1238
+
or
1239
+
1240
+
```sql
1241
+
--%tags(api,online,json)
1242
+
```
1243
+
1244
+
1245
+
1246
+
Tags are defined as a coma separated list. When executing a tests filtering by tag utPLSQL will find all tests associated with a given tag and execute it. It will apply `OR` logic when resolving a tags so any tests / suites that got matching at least one tag will get executed.
1247
+
1248
+
When a suite gets tagged all of its children will automatically inherit a tag and get executed along the parent.
1249
+
1250
+
```sql
1251
+
create or replace PACKAGE ut_sample_test IS
1252
+
1253
+
--%suite(Sample Test Suite)
1254
+
--%tag(suite1)
1255
+
1256
+
--%test(Compare Ref Cursors)
1257
+
--%tag(test1,sample)
1258
+
PROCEDURE ut_refcursors1;
1259
+
1260
+
END ut_sample_test;
1261
+
/
1262
+
1263
+
create or replace PACKAGE BODY ut_sample_test IS
1264
+
1265
+
PROCEDURE ut_refcursors1 IS
1266
+
v_actual SYS_REFCURSOR;
1267
+
v_expected SYS_REFCURSOR;
1268
+
BEGIN
1269
+
open v_expected for select1as test from dual;
1270
+
open v_actual for select2as test from dual;
1271
+
1272
+
ut.expect(v_actual).to_equal(v_expected);
1273
+
END;
1274
+
1275
+
END ut_sample_test;
1276
+
/
1277
+
```
1278
+
1279
+
Execution of the test is done by using a new parameter `a_tags`
0 commit comments