Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
133ecae
Adding new API user.
lwasylow Mar 22, 2019
9db8f4b
Separating tests.
lwasylow Mar 23, 2019
13f772a
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Mar 24, 2019
c56943e
Update properties
lwasylow Mar 24, 2019
5afba10
Change user that executes tests as helper that is super user.
lwasylow Mar 24, 2019
7cd92e7
Adding next set of tests migrated.
lwasylow Mar 24, 2019
e2561bc
Adding next set of tests migrated.
lwasylow Mar 25, 2019
887e46a
Fixing test package
lwasylow Mar 25, 2019
28dbd1e
Added set of tests:
lwasylow Mar 25, 2019
d7eb125
Adding set of tests :
lwasylow Mar 25, 2019
99e1099
Adding schema prefix to failing tests from 12.1
lwasylow Mar 25, 2019
04cd36c
Fixing development scripts
lwasylow Mar 25, 2019
3e98723
Fixed bug for deployments with uninstall included.
jgebal Mar 25, 2019
ba83f8f
Merge branch 'feature/introduce_testing_with_accurate_grants' of gith…
lwasylow Mar 26, 2019
0bf1d9e
FIX : removal of non existing types from uninstall script
lwasylow Mar 26, 2019
e914d96
INSTALL:Is it too many monkeys ?:)
lwasylow Mar 26, 2019
174dcbc
Adding set of tests:
lwasylow Mar 26, 2019
0c05daf
Adding set of tests:
lwasylow Mar 26, 2019
80783c3
Adding set of tests:
lwasylow Mar 28, 2019
c4b08af
Adding set of tests:
lwasylow Mar 28, 2019
0618616
Adding set of tests:
lwasylow Mar 28, 2019
29295b7
Adding set of tests:
lwasylow Mar 29, 2019
30b0cfe
Adding set of tests:
lwasylow Mar 29, 2019
3cc34ea
Adding tests
lwasylow Mar 29, 2019
a6a848d
Adding tests:
lwasylow Mar 30, 2019
858372c
Adding set of tests:
lwasylow Mar 31, 2019
620fd61
Adding extra tests:
lwasylow Mar 31, 2019
e6b0673
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Mar 31, 2019
c508e79
Adding tests:
lwasylow Apr 1, 2019
858a675
Fixing broken test.
lwasylow Apr 1, 2019
1642f47
Adding test:
lwasylow Apr 1, 2019
30d27fe
Adding global setup
lwasylow Apr 1, 2019
3b07c6a
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Apr 2, 2019
a8dfa14
Merge branch 'develop' of github.com:utPLSQL/utPLSQL into feature/int…
lwasylow Apr 2, 2019
5d3b18c
Update cleanup script after branching from random order branch
lwasylow Apr 2, 2019
b56d27a
Fixed invalid suitepath in `core` package.
jgebal Apr 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adding new API user.
  • Loading branch information
lwasylow committed Mar 23, 2019
commit 133ecaef7e57cfb0ed448118822aa05d6a88258a
30 changes: 18 additions & 12 deletions .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,33 @@ grant select any dictionary to $UT3_OWNER;
grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER;
SQL

#Create user that will own the tests
#Create user that will own the tests that are relevant to internal framework
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
set feedback off
@create_utplsql_owner.sql $UT3_TESTER $UT3_TESTER_PASSWORD $UT3_TABLESPACE

--needed for testing distributed transactions
grant create public database link to $UT3_TESTER;
grant drop public database link to $UT3_TESTER;
set feedback on
--Needed for testing coverage outside of main UT3 schema.
grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table, select any dictionary to $UT3_TESTER;
revoke execute on dbms_crypto from $UT3_TESTER;
grant create job to $UT3_TESTER;
exit
SQL

#Create additional UT3$USER# to test for special characters
#Create additional UT3$USER# to test for special characters and front end API testing
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
set feedback off
@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
--Grant UT3 framework to UT3$USER#
--Grant UT3 framework to min user
@create_user_grants.sql $UT3_OWNER $UT3_USER
exit
SQL

#Create additional UT3_TESTER_HELPER that will provide a functions to allow min grant test user setup test
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
set feedback off
@create_utplsql_owner.sql $UT3_TESTER_HELPER $UT3_TESTER_HELPER_PASSWORD $UT3_TABLESPACE
--needed for testing distributed transactions
grant create public database link to $UT3_TESTER_HELPER;
grant drop public database link to $UT3_TESTER_HELPER;
set feedback on
--Needed for testing coverage outside of main UT3 schema.
grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table, select any dictionary to $UT3_TESTER_HELPER;
revoke execute on dbms_crypto from $UT3_TESTER_HELPER;
grant create job to $UT3_TESTER_HELPER;
exit
SQL
3 changes: 2 additions & 1 deletion development/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#goto git root directory
git rev-parse && cd "$(git rev-parse --show-cdup)"

. development/env.sh
#. development/env.sh

"${SQLCLI}" sys/${ORACLE_PWD}@//${CONNECTION_STR} AS SYSDBA <<-SQL
set echo on
Expand All @@ -21,6 +21,7 @@ end;
drop user ${UT3_OWNER} cascade;
drop user ${UT3_RELEASE_VERSION_SCHEMA} cascade;
drop user ${UT3_TESTER} cascade;
drop user ${UT3_TESTER_HELPER} cascade;
drop user ${UT3_USER} cascade;

begin
Expand Down
2 changes: 1 addition & 1 deletion development/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#goto git root directory
git rev-parse && cd "$(git rev-parse --show-cdup)"

. development/env.sh
#. development/env.sh

header="******************************************************************************************"
if ! development/cleanup.sh; then
Expand Down
3 changes: 2 additions & 1 deletion development/template.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export UT3_TESTER_PASSWORD=ut3
export UT3_TABLESPACE=users
export UT3_USER="UT3\$USER#"
export UT3_USER_PASSWORD=ut3

export UT3_TESTER_HELPER=ut3_tester_helper
Comment thread
lwasylow marked this conversation as resolved.
Outdated
export UT3_TESTER_HELPER_PASSWORD=ut3
42 changes: 42 additions & 0 deletions test/install_ut3_tester_helper.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
set define off
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback

alter session set plsql_optimize_level=0;
--Install ut3_tester_helper
@@ut3_tester_helper/core.pks

@@ut3_tester_helper/core.pkb


grant execute on ut3_tester_helper.core to UT3$USER#;

set linesize 200
set define on
set verify off
column text format a100
column error_count noprint new_value error_count

prompt Validating installation

set heading on
select type, name, sequence, line, position, text, count(1) over() error_count
from all_errors
where owner = USER
and name not like 'BIN$%' --not recycled
and name != 'UT_WITH_INVALID_BODY'
-- errors only. ignore warnings
and attribute = 'ERROR'
order by name, type, sequence
/

begin
if to_number('&&error_count') > 0 then
raise_application_error(-20000, 'Not all sources were successfully installed.');
else
dbms_output.put_line('Installation completed successfully');
end if;
end;
/

exit;
39 changes: 39 additions & 0 deletions test/install_ut3_user_tests.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
set define off
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback

alter session set plsql_optimize_level=0;

prompt Install user tests
@@ut3_user/expectations/test_matchers.pks
@@ut3_user/expectations/test_matchers.pkb

set linesize 200
set define on
set verify off
column text format a100
column error_count noprint new_value error_count

prompt Validating installation

set heading on
select type, name, sequence, line, position, text, count(1) over() error_count
from all_errors
where owner = USER
and name not like 'BIN$%' --not recycled
and name != 'UT_WITH_INVALID_BODY'
-- errors only. ignore warnings
and attribute = 'ERROR'
order by name, type, sequence
/

begin
if to_number('&&error_count') > 0 then
raise_application_error(-20000, 'Not all sources were successfully installed.');
else
dbms_output.put_line('Installation completed successfully');
end if;
end;
/

exit;
33 changes: 33 additions & 0 deletions test/core.pkb → test/ut3_tester_helper/core.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,38 @@ create or replace package body core is
return l_glob_val;
end;

function get_failed_expectations return ut3.ut_varchar2_list is
l_expectations_result ut3.ut_expectation_results := ut3.ut_expectation_processor.get_failed_expectations();
l_result ut3.ut_varchar2_list;
begin
for i in 1..l_expectations_result.count loop
l_result := l_result multiset union l_expectations_result(i).get_result_lines();
end loop;
return l_result;
end;

function failed_expectations_data return anydata is
begin
return anydata.convertCollection(ut3.ut_expectation_processor.get_failed_expectations());
end;

function get_failed_expectations_n return number is
l_num_failed number;
l_results ut3.ut_expectation_results := ut3.ut_expectation_processor.get_failed_expectations();
begin
l_num_failed := l_results.count;
return l_num_failed;
end;

procedure clear_expectations is
begin
ut3.ut_expectation_processor.clear_expectations();
end;

function table_to_clob(a_results in ut3.ut_varchar2_list) return clob is
begin
return ut3.ut_utils.table_to_clob(a_results);
end;

end;
/
11 changes: 11 additions & 0 deletions test/core.pks → test/ut3_tester_helper/core.pks
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
create or replace package core is

gc_success number := ut3.ut_utils.gc_success;
gc_failure number := ut3.ut_utils.gc_failure;

--%suite
--%suitepath(utplsql)

Expand All @@ -16,6 +19,14 @@ create or replace package core is
function get_value(a_variable varchar2) return integer;

function get_dbms_output_as_clob return clob;

function get_failed_expectations return ut3.ut_varchar2_list;

function get_failed_expectations_n return number;

procedure clear_expectations;

function table_to_clob(a_results in ut3.ut_varchar2_list) return clob;

end;
/
Loading