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
Prev Previous commit
Next Next commit
Adding next set of tests migrated.
expectations/binary/test_equal
expectations/binary/test_expect_to_be_less_than
expectations/test_expectation_anydata
expectations/test_expectation_processor
  • Loading branch information
lwasylow committed Mar 24, 2019
commit 7cd92e77e4807e1ae33776a2b70ab05211df8d09
35 changes: 35 additions & 0 deletions test/grant_ut3_owner_to_ut3_tester.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
set define off
whenever sqlerror exit failure rollback
whenever oserror exit failure rollback

alter session set plsql_optimize_level=0;

set linesize 200
set define on
set verify off

prompt Empowering UT3_TESTER to UT3_OWNER objects

begin
for i in ( select object_name from all_objects t
where t.object_type in ('PACKAGE','TYPE')
and owner = 'UT3'
and generated = 'N'
and lower(object_name) not like 'sys%')
loop
execute immediate 'grant execute on ut3.'||i.object_name||' to UT3_TESTER';
end loop;
end;
/

prompt Empowering UT3_TESTER to UT3_OWNER tables

begin
for i in ( select table_name from all_tables t where owner = 'UT3' and nested = 'NO' and IOT_TYPE is NULL)
loop
execute immediate 'grant select on UT3.'||i.table_name||' to UT3_TESTER';
end loop;
end;
/

exit;
2 changes: 2 additions & 0 deletions test/install_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ git rev-parse && cd "$(git rev-parse --show-cdup)"

cd test

time "$SQLCLI" sys/${ORACLE_PWD}@//${CONNECTION_STR} AS SYSDBA @grant_ut3_owner_to_ut3_tester.sql

time "$SQLCLI" ${UT3_TESTER_HELPER}/${UT3_TESTER_HELPER_PASSWORD}@//${CONNECTION_STR} @install_ut3_tester_helper.sql

time "$SQLCLI" ${UT3_USER}/${UT3_USER_PASSWORD}@//${CONNECTION_STR} @install_ut3_user_tests.sql
Expand Down
6 changes: 6 additions & 0 deletions test/install_ut3_tester_helper.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ whenever oserror exit failure rollback
alter session set plsql_optimize_level=0;
--Install ut3_tester_helper
@@ut3_tester_helper/test_dummy_object.tps
@@ut3_tester_helper/other_dummy_object.tps
@@ut3_tester_helper/test_dummy_object_list.tps
@@ut3_tester_helper/test_tab_varchar2.tps
@@ut3_tester_helper/test_tab_varray.tps

@@ut3_tester_helper/main_helper.pks
@@ut3_tester_helper/run_helper.pks
@@ut3_tester_helper/expectations_helper.pks

@@ut3_tester_helper/main_helper.pkb
@@ut3_tester_helper/run_helper.pkb
@@ut3_tester_helper/expectations_helper.pkb

set linesize 200
set define on
Expand Down
4 changes: 4 additions & 0 deletions test/install_ut3_tester_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ alter session set plsql_optimize_level=0;


--Install tests
@@ut3_tester/core.pks
@@ut3_tester/core/annotations/test_before_after_annotations.pks
@@ut3_tester/core/expectations/test_expectation_processor.pks

@@ut3_tester/core.pkb
@@ut3_tester/core/annotations/test_before_after_annotations.pkb
@@ut3_tester/core/expectations/test_expectation_processor.pkb

set linesize 200
set define on
Expand Down
6 changes: 6 additions & 0 deletions test/install_ut3_user_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ whenever oserror exit failure rollback
alter session set plsql_optimize_level=0;

prompt Install user tests
@@ut3_user/expectations/binary/test_equal.pks
@@ut3_user/expectations/binary/test_expect_to_be_less_than.pks
@@ut3_user/expectations/test_matchers.pks
@@ut3_user/expectations/test_expectation_anydata.pks
@@ut3_user/expectations/test_expectations_cursor.pks
@@ut3_user/api/test_ut_runner.pks

@@ut3_user/expectations/binary/test_equal.pkb
@@ut3_user/expectations/binary/test_expect_to_be_less_than.pkb
@@ut3_user/expectations/test_matchers.pkb
@@ut3_user/expectations/test_expectation_anydata.pkb
@@ut3_user/expectations/test_expectations_cursor.pkb
@@ut3_user/api/test_ut_runner.pkb

Expand Down
11 changes: 11 additions & 0 deletions test/ut3_tester/core.pkb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
create or replace package body core is

procedure global_setup is
begin
ut3.ut_coverage.set_develop_mode(true);
--improve performance of test execution by disabling all compiler optimizations
ut3_tester_helper.main_helper.execute_autonomous('ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL=0');
end;

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

--%suite
--%suitepath(utplsql)

--%beforeall
procedure global_setup;

end;
/
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
create or replace package test_before_after_annotations is

--%suite(annotations - beforetest and aftertest)
--%suitepath(utplsql.core.annotations)
--%suitepath(utplsql.framework_tester.core.annotations)

subtype t_procedure_name is varchar2(250) not null;
type t_procedures is table of t_procedure_name;
Expand Down
125 changes: 0 additions & 125 deletions test/ut3_tester/core/core.pkb

This file was deleted.

32 changes: 0 additions & 32 deletions test/ut3_tester/core/core.pks

This file was deleted.

71 changes: 71 additions & 0 deletions test/ut3_tester/core/expectations/test_expectation_processor.pkb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
create or replace package body test_expectation_processor is

procedure who_called_expectation is
l_stack_trace varchar2(4000);
l_source_line varchar2(4000);
begin
l_stack_trace := q'[----- PL/SQL Call Stack -----
object line object
handle number name
34f88e4420 124 package body SCH_TEST.UT_EXPECTATION_PROCESSOR
353dfeb2f8 26 SCH_TEST.UT_EXPECTATION_RESULT
cba249ce0 112 SCH_TEST.UT_EXPECTATION
3539881cf0 21 SCH_TEST.UT_EXPECTATION_NUMBER
351a608008 28 package body SCH_TEST.TPKG_PRIOR_YEAR_GENERATION
351a6862b8 6 anonymous block
351fe31010 1825 package body SYS.DBMS_SQL
20befbe4d8 129 SCH_TEST.UT_EXECUTABLE
20befbe4d8 65 SCH_TEST.UT_EXECUTABLE
34f8ab7cd8 80 SCH_TEST.UT_TEST
34f8ab98f0 48 SCH_TEST.UT_SUITE_ITEM
34f8ab9b10 74 SCH_TEST.UT_SUITE
34f8ab98f0 48 SCH_TEST.UT_SUITE_ITEM
cba24bfd0 75 SCH_TEST.UT_LOGICAL_SUITE
353dfecf30 59 SCH_TEST.UT_RUN
34f8ab98f0 48 SCH_TEST.UT_SUITE_ITEM
357f5421e8 77 package body SCH_TEST.UT_RUNNER
357f5421e8 111 package body SCH_TEST.UT_RUNNER
20be951ab0 292 package body SCH_TEST.UT
20be951ab0 320 package body SCH_TEST.UT
]';
ut.expect(
ut3.ut_expectation_processor.who_called_expectation(l_stack_trace)
).to_be_like('at "SCH_TEST.TPKG_PRIOR_YEAR_GENERATION", line 28 %');
end;


procedure who_called_expectation_0x is
l_stack_trace varchar2(4000);
l_source_line varchar2(4000);
begin
l_stack_trace := q'[----- PL/SQL Call Stack -----
object line object
handle number name
34f88e4420 124 package body SCH_TEST.UT_EXPECTATION_PROCESSOR
353dfeb2f8 26 SCH_TEST.UT_EXPECTATION_RESULT
cba249ce0 112 SCH_TEST.UT_EXPECTATION
3539881cf0 21 SCH_TEST.UT_EXPECTATION_NUMBER
351a608008 28 package body SCH_TEST.TPKG_PRIOR_YEAR_GENERATION
351a6862b8 6 anonymous block
351fe31010 1825 package body SYS.DBMS_SQL
20befbe4d8 129 SCH_TEST.UT_EXECUTABLE
20befbe4d8 65 SCH_TEST.UT_EXECUTABLE
34f8ab7cd8 80 SCH_TEST.UT_TEST
34f8ab98f0 48 SCH_TEST.UT_SUITE_ITEM
34f8ab9b10 74 SCH_TEST.UT_SUITE
34f8ab98f0 48 SCH_TEST.UT_SUITE_ITEM
cba24bfd0 75 SCH_TEST.UT_LOGICAL_SUITE
353dfecf30 59 SCH_TEST.UT_RUN
34f8ab98f0 48 SCH_TEST.UT_SUITE_ITEM
357f5421e8 77 package body SCH_TEST.UT_RUNNER
357f5421e8 111 package body SCH_TEST.UT_RUNNER
20be951ab0 292 package body SCH_TEST.UT
20be951ab0 320 package body SCH_TEST.UT
]';
ut.expect(
ut3.ut_expectation_processor.who_called_expectation(l_stack_trace)
).to_be_like('at "SCH_TEST.TPKG_PRIOR_YEAR_GENERATION", line 28 %');
end;

end;
/
17 changes: 17 additions & 0 deletions test/ut3_tester/core/expectations/test_expectation_processor.pks
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
create or replace package test_expectation_processor is

--%suite(expectation_processor)
--%suitepath(utplsql.framework_tester.core.expectations)

--%context(who_called_expectation)

--%test(parses stack trace and returns object and line that called expectation)
procedure who_called_expectation;

--%test(parses stack trace containing 0x and returns object and line that called expectation)
procedure who_called_expectation_0x;

--%endcontext

end;
/
Loading