Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Added `version_compatibility_check` function to ut_runner #464
Conversation
| @@ -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 | |||
pesse
Aug 25, 2017
Member
IMO this function should raise an exception with proper message if an illegal version-no string is provided.
IMO this function should raise an exception with proper message if an illegal version-no string is provided.
| @@ -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 | |||
pesse
Aug 25, 2017
Member
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?
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?
jgebal
Aug 25, 2017
Author
Member
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
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
Pazus
Aug 26, 2017
Member
You can't overload a funtion with a version which differes ony in return type.
You can't overload a funtion with a version which differes ony in return type.
| 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; | ||
|
|
pesse
Aug 25, 2017
Member
There should be tests to ensure version_compatibility_check behaves correctly (exception) when providing illegal version strings
There should be tests to ensure version_compatibility_check behaves correctly (exception) when providing illegal version strings
jgebal
Aug 25, 2017
Author
Member
good point
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. |
|
Looks really great now, only the documentation about what error code is thrown is wrong |
| * | ||
| * @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 |
| * @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 |
Resolves #430
Added version parsing.
Changed value of
gc_versionvariable inut_utils