-
Notifications
You must be signed in to change notification settings - Fork 185
Added version_compatibility_check
function to ut_runner
#464
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
Conversation
source/core/ut_utils.pkb
Outdated
@@ -384,5 +384,18 @@ create or replace package body ut_utils is | |||
commit; | |||
end; | |||
|
|||
function to_version(p_version_no varchar2) return t_version is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this function should raise an exception with proper message if an illegal version-no string is provided.
source/api/ut_runner.pkb
Outdated
@@ -43,6 +43,19 @@ create or replace package body ut_runner is | |||
return ut_utils.gc_version; | |||
end; | |||
|
|||
function version_compatibility_check( a_requested varchar2, a_current varchar2 := null ) return boolean is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For boolean is not a SQL type but only PL/SQL (I guess it's still working that way) it might be more complicated to implement the Java request to this function, cause we can't just select version_compatibility_check(?) from dual
What do you think about return 0/1? Or adding another function, wrapping the boolean one and returning 0/1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting observation.
We already have bool ->init and int->bool so the change will be quite simple.
I'm just wondering how would the select statement behave with overloaded functions (with boolan and integer return type) - will need to check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't overload a funtion with a version which differes ony in return type.
test/ut_runner/test_ut_runner.pkb
Outdated
ut.expect( ut3.ut_runner.version_compatibility_check('v3.0.0.0','v3.0.0.123') ).to_be_true; | ||
ut.expect( ut3.ut_runner.version_compatibility_check('v3.0.0','v3.0.0.0') ).to_be_true; | ||
end; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be tests to ensure version_compatibility_check behaves correctly (exception) when providing illegal version strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
…wing exception on version check, added tests for throwing exception.
# Conflicts: # test/install_and_run_tests.sh # test/install_tests.sql # test/ut_utils/test_ut_utils.pkb
I'm ok with the changes so lets wait for @pesse reviewal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really great now, only the documentation about what error code is thrown is wrong
source/core/ut_utils.pks
Outdated
* | ||
* @param a_version_no string representation of version in format vX.X.X.X where X is a positive integer | ||
* @return t_version record with up to four positive numbers containing version | ||
* @throws 20010 if passed version string is not matching version pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@throws 20214, not 20010
source/api/ut_runner.pks
Outdated
* @param a_requested requested utPLSQL version string | ||
* @param a_current current utPLSQL version string, if null is passed, defaults to current framework version | ||
* @return 1/0 1-true, 0-false | ||
* @exception 20010 if passed version string is not matching version pattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@throws 20214, not 20010
Resolves #430
Added version parsing.
Changed value of
gc_version
variable inut_utils