Implemented the runner to execute suites/tests by path#113
Implemented the runner to execute suites/tests by path#113rlove merged 12 commits intoutPLSQL:version3from
Conversation
The path supports several formats: * <schema> * <schema>:<suitepath>[.<test_proc_name>] * <schema>.<suite_package>[.<test_proc_name>] The user-freandly interface is located in `ut` package Also made some refactoring with ut_test objects, put object_path property there to store fully qualified path to suite/test object name now contains only the name of the object (package/procedure)
| @@ -1,8 +1,23 @@ | |||
| create or replace type body ut_test_object is | |||
|
|
|||
| member procedure init(self in out nocopy ut_test_object, a_desc_name varchar2, a_object_name varchar2, a_object_type integer, a_object_path varchar2 default null, a_rollback_type integer default null) is | |||
There was a problem hiding this comment.
Nice. Placing common code in common place.
| self.rollback_type := a_rollback_type; | ||
| end; | ||
|
|
||
| member procedure set_object_path(self in out nocopy ut_test_object, a_path varchar2) is |
There was a problem hiding this comment.
Is this code used? I do not see any calls to set_object_path.
| lower(l_object_name); | ||
| else | ||
| l_suite_package := lower(l_object_name); | ||
| --else |
There was a problem hiding this comment.
What are the implications of this change (what will happen now on else)?
Do we need the commented code?
| ut_utils.gc_rollback_manual | ||
| when 'auto' then | ||
| ut_utils.gc_rollback_auto | ||
| --when 'on-error' then |
There was a problem hiding this comment.
not now. this remindes about the third type of transaction control. it might became possible to implement after your changes to ut_executable
| l_path varchar2(32767); | ||
| begin | ||
| if a_paths is null or a_paths.count = 0 then | ||
| raise_application_error(ut_utils.gc_path_list_is_empty, 'Path list is empty'); |
There was a problem hiding this comment.
Maybe we should run all current schema tests, if NULL or empty?
There was a problem hiding this comment.
though about it but for now decided not to do it as it get much more difficult to figure out what is really called. the path will always be in form suite1.suite2.test and we have to understant wether its a suitepath of current schema ot suite1 is the schema name. Guessing mechanism is not yet implemented
| else | ||
| for i in 1 .. a_paths.count loop | ||
| l_path := a_paths(i); | ||
| if regexp_like(l_path, '^\w+(\.\w+){0,2}$') or regexp_like(l_path, '^\w+:\w+(\.\w+)*$') then |
There was a problem hiding this comment.
how about:
if not( regexp_like(l_path, '^\w+(\.\w+){0,2}$') or regexp_like(l_path, '^\w+:\w+(\.\w+)*$') ) then
raise_...
end if;
| l_package_name := regexp_substr(l_path, '^\w+\.(\w+)(\.(\w+))?$', subexpression => 1); | ||
| l_procedure_name := regexp_substr(l_path, '^\w+\.(\w+)(\.(\w+))?$', subexpression => 3); | ||
|
|
||
| l_temp_suite := config_package(l_schema, l_package_name); |
There was a problem hiding this comment.
Do we need to fetch/parse the package again? We already have whole schema suites in variable in line 438.
There was a problem hiding this comment.
Then we will have to work through the whole hierarcy looking for object_name... but maybe you are right. i'll come back to it today a bit later.
| end; | ||
| end if; | ||
|
|
||
| if regexp_like(l_path, '^\w+:.+$') then |
|
|
||
| validate_paths(l_paths); | ||
|
|
||
| -- current implementation operates only on a single path |
There was a problem hiding this comment.
Maybe it would be better to extract the find/filter logic into separate procedure?
There was a problem hiding this comment.
i feel such separation won't work for multiple pathes provided as be each next path you won't simply add new object to the list, rather you will enable objects in current list to execute... I'd like to postepone this refactoring a bit until it became clear for multi-path approach. But I agree it is needed
| end loop; | ||
|
|
||
| if l_objects_to_run.count > 0 then | ||
| l_reporter.before_run(a_suites => l_objects_to_run); |
There was a problem hiding this comment.
Nice.
Now we pass the full list of objects to execute to the before/after calls.
|
Resolves #86 |
|
Added tests |
Implemented the runner to execute suites/tests by path
The path supports several formats:
The user-freandly interface is located in
utpackageAlso made some refactoring with ut_test objects, put object_path property there to store fully qualified path to suite/test
object name now contains only the name of the object (package/procedure)