★ wanayoo — archive 1999 https://github.com/utPLSQL/utPLSQL/pull/464Nouvelle recherche | Portail wanayoo
Skip to content
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

Added `version_compatibility_check` function to ut_runner #464

Merged
merged 9 commits into from Aug 28, 2017

Conversation

@jgebal
Copy link
Member

@jgebal jgebal commented Aug 21, 2017 •

Resolves #430
Added version parsing.
Changed value of gc_version variable in ut_utils

@jgebal jgebal added the enhancement label Aug 21, 2017
@jgebal jgebal added this to the v3.0.3 milestone Aug 21, 2017
@jgebal jgebal self-assigned this Aug 21, 2017
@jgebal jgebal requested review from viniciusam and Pazus Aug 21, 2017
@@ -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

This comment has been minimized.

@pesse

pesse Aug 25, 2017
Member

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

This comment has been minimized.

@pesse

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?

This comment has been minimized.

@jgebal

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

This comment has been minimized.

@Pazus

Pazus Aug 26, 2017
Member

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;

This comment has been minimized.

@pesse

pesse Aug 25, 2017
Member

There should be tests to ensure version_compatibility_check behaves correctly (exception) when providing illegal version strings

This comment has been minimized.

@jgebal

jgebal Aug 25, 2017
Author Member

good point

jgebal added 2 commits Aug 26, 2017
…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
@Pazus
Pazus approved these changes Aug 27, 2017
@Pazus
Copy link
Member

@Pazus Pazus commented Aug 27, 2017

I'm ok with the changes so lets wait for @pesse reviewal.

Copy link
Member

@pesse pesse left a comment

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

This comment has been minimized.

@pesse

pesse Aug 28, 2017
Member

@throws 20214, not 20010

* @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

This comment has been minimized.

@pesse

pesse Aug 28, 2017
Member

@throws 20214, not 20010

pesse added 2 commits Aug 28, 2017
@pesse
pesse approved these changes Aug 28, 2017
@jgebal jgebal merged commit 312fb95 into develop Aug 28, 2017
3 checks passed
3 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.5%) to 90.536%
Details
@jgebal jgebal deleted the feature/add_version_check branch Aug 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.