-
Notifications
You must be signed in to change notification settings - Fork 185
Add support for contex/sub-suite #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The issue is for nested suites, right? |
yes |
It seems like a valuable extension. Currently when your PROD package has 20 procedures, and your test package has 200 tests (10 per procedure) it might be hard to navigate and hard to read. package ut_depatments_api is
--%suite(Departments api)
--%beforeall
procedure common_setup;
--%context(Add departments)
--%beforeall
procedure add_departments_setup;
--%test(Adds a department)
procedure successfully_add_department;
--%test(Raises exception when department name is NULL)
procedure add_department_null_name;
--%test(Raises exception when department name is duplicated)
procedure add_department_dup_name;
--%endcontext
--%context(Remove department)
-- and so on...
--%endcontext
end; |
some ideas:
|
Example: package test_common is
--%suite(Departments api)
--%sutepath(org.utplsql.demo)
--%beforeall
procedure global_setup;
--%test
procedure some_test_for_global_stuff;
--%test
procedure other_test_for_global_stuff;
end;
/
package test_depatments_api is
--%suite(Departments api)
--%sutepath(org.utplsql.demo.test_common)
--%beforeall
procedure common_setup;
--%context(Add departments)
--%beforeall
procedure add_departments_setup;
--%test(Adds a department)
procedure successfully_add_department;
--%test(Raises exception when department name is NULL)
procedure add_department_null_name;
--%test(Raises exception when department name is duplicated)
procedure add_department_dup_name;
--%endcontext
--%context(Remove department)
--%beforeall
procedure remove_departments_setup;
--%test(Removes a department by name)
procedure remove_department_success;
--%test(Fails to remove department with employees)
procedure remove_department_failure;
--%endcontext
--%test(get_departments retuns all departments)
procedure get_departments;
--%test(update department changes deparment name)
procedure update_department;
end; Context can define it's own before/after blocks When I execute:
Given the above, the test results report could also be:
Randomization of test ordering is still possible within the bounduaries of common container. |
Why not add the context annotation for every procedure? The kind of grouping with context and endcontext isn't very PLSQL-esque. The position of the procedure (in the package specification at least) determines the context for which it runs. I would rather like to see an addition next to the %test% annotation, for example a %testcontext% annotation. |
As I build my tests, I'd like to be able to group all of tests for one procedure in a package.
So that all tests for one procedure are grouped in a context/sub-suite within test package.
The values of that would be:
beforeall
/afterall
The text was updated successfully, but these errors were encountered: