diff --git a/.travis.yml b/.travis.yml index a6aecb53c..58aa254e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,7 +95,7 @@ before_script: script: - if [[ ! $TRAVIS_TAG ]]; then bash test/install_and_run_tests.sh; fi - if [[ ! $TRAVIS_TAG ]]; then bash .travis/validate_report_files.sh; fi - - if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then bash .travis/run_sonar_scanner.sh; fi + - if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "${TRAVIS_PULL_REQUEST_SLUG}" = "${TRAVIS_REPO_SLUG}" ]; then bash .travis/run_sonar_scanner.sh; fi - if [[ ! $TRAVIS_TAG ]]; then bash .travis/coveralls_uploader.sh; fi notifications: diff --git a/source/create_synonyms_and_grants_for_public.sql b/source/create_synonyms_and_grants_for_public.sql index 17452ec0c..1ac5bb9ea 100644 --- a/source/create_synonyms_and_grants_for_public.sql +++ b/source/create_synonyms_and_grants_for_public.sql @@ -76,8 +76,8 @@ grant execute on &&ut3_owner..ut_file_mapping to public; grant execute on &&ut3_owner..ut_file_mapper to public; grant execute on &&ut3_owner..ut_key_value_pairs to public; grant execute on &&ut3_owner..ut_key_value_pair to public; -grant select, insert, delete on &&ut3_owner..ut_compound_data_tmp to public; -grant select, insert, delete on &&ut3_owner..ut_compound_data_diff_tmp to public; +grant select, insert, update, delete on &&ut3_owner..ut_compound_data_tmp to public; +grant select, insert, update, delete on &&ut3_owner..ut_compound_data_diff_tmp to public; grant execute on &&ut3_owner..ut_sonar_test_reporter to public; grant execute on &&ut3_owner..ut_annotations to public; grant execute on &&ut3_owner..ut_annotation to public; diff --git a/source/create_user_grants.sql b/source/create_user_grants.sql index bae0364be..07d9097f3 100644 --- a/source/create_user_grants.sql +++ b/source/create_user_grants.sql @@ -96,8 +96,8 @@ grant execute on &&ut3_owner..ut_file_mapping to &ut3_user; grant execute on &&ut3_owner..ut_file_mapper to &ut3_user; grant execute on &&ut3_owner..ut_key_value_pairs to &ut3_user; grant execute on &&ut3_owner..ut_key_value_pair to &ut3_user; -grant select, insert, delete on &&ut3_owner..ut_compound_data_tmp to &ut3_user; -grant select, insert, delete on &&ut3_owner..ut_compound_data_diff_tmp to &ut3_user; +grant select, insert, update, delete on &&ut3_owner..ut_compound_data_tmp to &ut3_user; +grant select, insert, update, delete on &&ut3_owner..ut_compound_data_diff_tmp to &ut3_user; grant execute on &&ut3_owner..ut_sonar_test_reporter to &ut3_user; grant execute on &&ut3_owner..ut_annotations to &ut3_user; grant execute on &&ut3_owner..ut_annotation to &ut3_user; diff --git a/test/api/test_ut_run.pkb b/test/api/test_ut_run.pkb index 704627ac9..dae7e175a 100644 --- a/test/api/test_ut_run.pkb +++ b/test/api/test_ut_run.pkb @@ -589,7 +589,7 @@ create or replace package body test_ut_run is failing_stateful_test [% sec] (FAILED - 1)% Failures:% 1) failing_stateful_test - ORA-04068: existing state of packages (DB_LOOPBACK) has been discarded + ORA-04068: existing state of packages (DB_LOOPBACK%) has been discarded ORA-04061: existing state of package body "UT3_TESTER.STATEFUL_PACKAGE" has been invalidated ORA-04065: not executed, altered or dropped package body "UT3_TESTER.STATEFUL_PACKAGE"% ORA-06512: at line 6% diff --git a/test/core/annotations/test_annot_throws_exception.pkb b/test/core/annotations/test_annot_throws_exception.pkb index 2c8c3be2c..1ad4f19a5 100644 --- a/test/core/annotations/test_annot_throws_exception.pkb +++ b/test/core/annotations/test_annot_throws_exception.pkb @@ -240,43 +240,43 @@ is procedure throws_same_annotated_except is begin - ut.expect(g_tests_results).to_match('^\s*Throws same annotated exception \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Throws same annotated exception \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('raised_same_exception'); end; procedure throws_one_of_annotated_excpt is begin - ut.expect(g_tests_results).to_match('^\s*Throws one of the listed exceptions \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Throws one of the listed exceptions \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('raised_one_listed_exception'); end; procedure throws_with_leading_zero is begin - ut.expect(g_tests_results).to_match('^\s*Leading zero is ignored in exception list \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Leading zero is ignored in exception list \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('leading_0_exception_no'); end; procedure throws_diff_annotated_except is begin - ut.expect(g_tests_results).to_match('^\s*Throws diff exception \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Throws diff exception \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); ut.expect(g_tests_results).to_match('raised_diff_exception\s+Actual: -20143 was expected to equal: -20144\s+ORA-20143: Test error\s+ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"'); end; procedure throws_empty is begin - ut.expect(g_tests_results).to_match('^\s*Throws empty \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Throws empty \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); ut.expect(g_tests_results).to_match('empty_throws\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"'); end; procedure bad_paramters_with_except is begin - ut.expect(g_tests_results).to_match('^\s*Ignores annotation and fails when exception was thrown \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Ignores annotation and fails when exception was thrown \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); ut.expect(g_tests_results).to_match('bad_paramters_with_except\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"'); end; procedure bad_paramters_without_except is begin - ut.expect(g_tests_results).to_match('^\s*Ignores annotation and succeeds when no exception thrown \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Ignores annotation and succeeds when no exception thrown \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('bad_paramters_without_except'); end; @@ -288,79 +288,79 @@ is procedure nothing_thrown is begin - ut.expect(g_tests_results).to_match('^\s*Gives failure when a exception is expected and nothing is thrown \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Gives failure when a exception is expected and nothing is thrown \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); ut.expect(g_tests_results).to_match('nothing_thrown\s*Expected one of exceptions \(-20459, -20136, -20145\) but nothing was raised.'); end; procedure single_exc_const_pkg is begin - ut.expect(g_tests_results).to_match('^\s*Single exception defined as a constant number in package \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Single exception defined as a constant number in package \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('single_exc_const_pkg'); end; procedure list_of_exc_constant is begin - ut.expect(g_tests_results).to_match('^\s*Gives success when one of annotated exception using constant is thrown \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Gives success when one of annotated exception using constant is thrown \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('list_of_exc_constant'); end; procedure fail_not_match_exc is begin - ut.expect(g_tests_results).to_match('^\s*Gives failure when the raised exception is different that the annotated one using variable \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Gives failure when the raised exception is different that the annotated one using variable \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); ut.expect(g_tests_results).to_match('fail_not_match_exc\s+Actual: -1403 was expected to equal: -20204\s+ORA-01403: no data found\s+ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"'); end; procedure mixed_exc_list is begin - ut.expect(g_tests_results).to_match('^\s*Success when one of exception from mixed list of number and constant is thrown \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Success when one of exception from mixed list of number and constant is thrown \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('mixed_exc_list'); end; procedure mixed_list_notexi is begin - ut.expect(g_tests_results).to_match('^\s*Success when match exception even if other variable on list dont exists \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Success when match exception even if other variable on list dont exists \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('mixed_list_notexi'); end; procedure named_exc_pragma is begin - ut.expect(g_tests_results).to_match('^\s*Success resolve and match named exception defined in pragma exception init \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Success resolve and match named exception defined in pragma exception init \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('mixed_list_notexi'); end; procedure named_exc_ora is begin - ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('named_exc_ora'); end; procedure named_exc_ora_dup_ind is begin - ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception dup val index \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception dup val index \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('named_exc_ora_dup_ind'); end; procedure nodata_exc_ora is begin - ut.expect(g_tests_results).to_match('^\s*Success map no data 100 to -1403 \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Success map no data 100 to -1403 \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('nodata_exc_ora'); end; procedure defined_varchar_exc is begin - ut.expect(g_tests_results).to_match('^\s*Success for exception defined as varchar \[[\.0-9]+ sec\]\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Success for exception defined as varchar \[[,\.0-9]+ sec\]\s*$','m'); ut.expect(g_tests_results).not_to_match('defined_varchar_exc'); end; procedure non_existing_const is begin - ut.expect(g_tests_results).to_match('^\s*Non existing constant exception \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Non existing constant exception \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); ut.expect(g_tests_results).to_match('non_existing_const\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"'); end; procedure bad_exc_const is begin - ut.expect(g_tests_results).to_match('^\s*Bad exception constant \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); + ut.expect(g_tests_results).to_match('^\s*Bad exception constant \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m'); ut.expect(g_tests_results).to_match('bad_exc_const\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"'); end; diff --git a/test/core/annotations/test_before_after_test_annotation.pkb b/test/core/annotations/test_before_after_annotations.pkb similarity index 98% rename from test/core/annotations/test_before_after_test_annotation.pkb rename to test/core/annotations/test_before_after_annotations.pkb index 06871a335..0aa9f5c39 100644 --- a/test/core/annotations/test_before_after_test_annotation.pkb +++ b/test/core/annotations/test_before_after_annotations.pkb @@ -277,7 +277,7 @@ create or replace package body test_before_after_annotations is ut.expect(l_actual).to_be_empty; ut.expect(g_tests_results).to_match( - '^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[\.0-9]+ sec\] \(FAILED - 1\)\s*$' + '^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[,\.0-9]+ sec\] \(FAILED - 1\)\s*$' ,'m' ); ut.expect(g_tests_results).to_match( @@ -297,7 +297,7 @@ create or replace package body test_before_after_annotations is ut.expect(l_actual).to_be_empty; ut.expect(g_tests_results).to_match( - '^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[\.0-9]+ sec\] \(FAILED - 1\)\s*$' + '^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[,\.0-9]+ sec\] \(FAILED - 1\)\s*$' ,'m' ); ut.expect(g_tests_results).to_match( diff --git a/test/core/annotations/test_before_after_test_annotation.pks b/test/core/annotations/test_before_after_annotations.pks similarity index 100% rename from test/core/annotations/test_before_after_test_annotation.pks rename to test/core/annotations/test_before_after_annotations.pks diff --git a/test/core/reporters/test_junit_reporter.pkb b/test/core/reporters/test_junit_reporter.pkb index 6cd67b8a3..e0a7ea00d 100644 --- a/test/core/reporters/test_junit_reporter.pkb +++ b/test/core/reporters/test_junit_reporter.pkb @@ -166,7 +166,7 @@ create or replace package body test_junit_reporter as l_nls_numeric_characters varchar2(30); begin --Arrange - select nsp.value into l_nls_numeric_characters + select replace(nsp.value,'''','''''') into l_nls_numeric_characters from nls_session_parameters nsp where parameter = 'NLS_NUMERIC_CHARACTERS'; execute immediate q'[alter session set NLS_NUMERIC_CHARACTERS=', ']'; diff --git a/test/core/reporters/test_tfs_junit_reporter.pkb b/test/core/reporters/test_tfs_junit_reporter.pkb index bd09b8682..122c665e3 100644 --- a/test/core/reporters/test_tfs_junit_reporter.pkb +++ b/test/core/reporters/test_tfs_junit_reporter.pkb @@ -149,7 +149,7 @@ create or replace package body test_tfs_junit_reporter as l_nls_numeric_characters varchar2(30); begin --Arrange - select nsp.value into l_nls_numeric_characters + select replace(nsp.value,'''','''''') into l_nls_numeric_characters from nls_session_parameters nsp where parameter = 'NLS_NUMERIC_CHARACTERS'; execute immediate q'[alter session set NLS_NUMERIC_CHARACTERS=', ']'; diff --git a/test/install_tests.sql b/test/install_tests.sql index 2aa60692c..2f1292b74 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -23,7 +23,7 @@ alter session set plsql_optimize_level=0; @@core/test_ut_test.pks @@core/annotations/test_annotation_parser.pks @@core/annotations/test_annotation_manager.pks -@@core/annotations/test_before_after_test_annotation.pks +@@core/annotations/test_before_after_annotations.pks @@core/expectations/test_expectation_processor.pks @@core/expectations/test_matchers.pks @@core/test_output_buffer.pks @@ -74,7 +74,7 @@ set define off @@core/annotations/test_annotation_manager.pkb @@core/expectations/test_expectation_processor.pkb @@core/expectations/test_matchers.pkb -@@core/annotations/test_before_after_test_annotation.pkb +@@core/annotations/test_before_after_annotations.pkb @@core/test_output_buffer.pkb @@core/test_file_mapper.pkb @@core/test_suite_manager.pkb