Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 633a25f

Browse files
authored
Merge pull request #176 from Pazus/feature/disabled_tag
renamed "disable" annotation to "disabled"
2 parents 6a061ed + 9ede108 commit 633a25f

7 files changed

Lines changed: 37 additions & 8 deletions

docs/userguide/annotations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ create or replace package test_pkg is
3838

3939
-- %test
4040
-- %displayname(Name of test3)
41-
-- %disable
41+
-- %disabled
4242
procedure test3;
4343

4444
-- %test(Name of test4)
@@ -73,4 +73,4 @@ end test_pkg;
7373
| `%beforetest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed before the annotated `%test` procedure. |
7474
| `%aftertest(<procedure_name>)` | Procedure | Denotes that mentioned procedure should be executed after the annotated `%test` procedure. |
7575
| `%rollback(<type>)` | Package/procedure | Configure transaction control behaviour (type). Supported values: `auto`(default) - rollback to savepoint (before the test/suite setup) is issued after each test/suite teardown; `manual` - rollback is never issued automatically. Property can be overridden for child element (test in suite) |
76-
| `%disable` | Package/procedure | Used to disable a suite or a test |
76+
| `%disabled` | Package/procedure | Used to disable a suite or a test |

examples/between_string/test_betwnstr.pkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ create or replace package test_betwnstr as
1515
procedure null_string;
1616

1717
-- %test(Demo of a disabled test)
18-
-- %disable
18+
-- %disabled
1919
procedure disabled_test;
2020

2121
end;

source/core/ut_suite_manager.pkb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ create or replace package body ut_suite_manager is
102102
a_path => l_suite_path, --a patch for this suite (excluding the package name of current suite)
103103
a_description => l_suite_name,
104104
a_rollback_type => l_suite_rollback,
105-
a_ignore_flag => l_annotation_data.package_annotations.exists('disable'),
105+
a_ignore_flag => l_annotation_data.package_annotations.exists('disabled'),
106106
a_before_all_proc_name => l_suite_setup_proc,
107107
a_after_all_proc_name => l_suite_teardown_proc,
108108
a_before_each_proc_name => l_default_setup_proc,
@@ -156,7 +156,7 @@ create or replace package body ut_suite_manager is
156156
a_description => l_displayname,
157157
a_path => l_suite.path || '.' || l_proc_name,
158158
a_rollback_type => l_rollback_type,
159-
a_ignore_flag => l_proc_annotations.exists('disable'),
159+
a_ignore_flag => l_proc_annotations.exists('disabled'),
160160
a_before_test_proc_name => l_setup_procedure,
161161
a_after_test_proc_name => l_teardown_procedure
162162
);

tests/helpers/test_package_3.pck

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ create or replace package test_package_3 is
2222
procedure test2_setup;
2323

2424
procedure test2_teardown;
25+
26+
--%test
27+
--%disabled
28+
procedure disabled_test;
2529

2630
end test_package_3;
2731
/
@@ -64,6 +68,11 @@ create or replace package body test_package_3 is
6468
gv_var_1 := gv_var_1_temp;
6569
gv_var_1_temp := null;
6670
end;
71+
72+
procedure disabled_test is
73+
begin
74+
null;
75+
end;
6776

6877
end test_package_3;
6978
/

tests/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheSchema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ begin
3131
ut.expect(l_test2_suite.items.count).to_equal(2);
3232
when 'tests2' then
3333
ut.expect(l_test1_suite.name).to_equal('test_package_3');
34-
ut.expect(l_test1_suite.items.count).to_equal(2);
34+
ut.expect(l_test1_suite.items.count).to_equal(3);
3535
end case;
3636

3737
end loop;

tests/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByName.sql

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ declare
77

88
l_test0_suite ut_logical_suite;
99
l_test1_suite ut_logical_suite;
10+
l_test1 ut_test;
11+
l_test3 ut_test;
1012
begin
1113
--Act
1214
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path));
@@ -20,7 +22,15 @@ begin
2022
l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite);
2123

2224
ut.expect(l_test1_suite.name).to_equal('test_package_3');
23-
ut.expect(l_test1_suite.items.count).to_equal(2);
25+
ut.expect(l_test1_suite.items.count).to_equal(3);
26+
27+
l_test1 := treat(l_test1_suite.items(1) as ut_test);
28+
ut.expect(l_test1.name).to_equal('test1');
29+
ut.expect(l_test1.ignore_flag).to_equal(0);
30+
31+
l_test3 := treat(l_test1_suite.items(3) as ut_test);
32+
ut.expect(l_test3.name).to_equal('disabled_test');
33+
ut.expect(l_test3.ignore_flag).to_equal(1);
2434

2535
if ut_assert_processor.get_aggregate_asserts_result = ut_utils.tr_success then
2636
:test_result := ut_utils.tr_success;

tests/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByPath.sql

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ declare
77

88
l_test0_suite ut_logical_suite;
99
l_test1_suite ut_logical_suite;
10+
l_test1 ut_test;
11+
l_test3 ut_test;
1012
begin
1113
--Act
1214
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path));
@@ -20,7 +22,15 @@ begin
2022
l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite);
2123

2224
ut.expect(l_test1_suite.name).to_equal('test_package_3');
23-
ut.expect(l_test1_suite.items.count).to_equal(2);
25+
ut.expect(l_test1_suite.items.count).to_equal(3);
26+
27+
l_test1 := treat(l_test1_suite.items(1) as ut_test);
28+
ut.expect(l_test1.name).to_equal('test1');
29+
ut.expect(l_test1.ignore_flag).to_equal(0);
30+
31+
l_test3 := treat(l_test1_suite.items(3) as ut_test);
32+
ut.expect(l_test3.name).to_equal('disabled_test');
33+
ut.expect(l_test3.ignore_flag).to_equal(1);
2434

2535
if ut_assert_processor.get_aggregate_asserts_result = ut_utils.tr_success then
2636
:test_result := ut_utils.tr_success;

0 commit comments

Comments
 (0)