Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
36a061c
Removed parsing of annotation text (params) from ut_annotations as an…
jgebal Oct 6, 2017
a29cabe
Removed duplicate `old_tests` for ut_annotations - the functionality …
jgebal Oct 6, 2017
58c6293
Renamed `ut_annotations` to `ut_annotation_parser` and moved to annot…
jgebal Oct 7, 2017
375a7ff
Removed ``ut_annotations` from uninstall script.
jgebal Oct 7, 2017
13703fa
Fixed failing old tests after refactoring.
jgebal Oct 7, 2017
ac23f15
Refactored ut_annotation_parser API to use `ut_annotations` collectio…
jgebal Oct 7, 2017
df2c763
Added cache mechanism to `ut_annotation_parser`.
jgebal Oct 8, 2017
6088c81
Added ability to get annotations for single object.
jgebal Oct 9, 2017
4ec9eb5
Reworking annotation cache - not to use cast(Collect()) on dba_source.
jgebal Oct 13, 2017
dbf2538
Fixed failing test and test for Wrapped package.
jgebal Oct 14, 2017
ca31e98
Added missing annotation manager.
jgebal Oct 14, 2017
289f006
Removed dbms_output from code.
jgebal Oct 14, 2017
8e26ed0
Merge remote-tracking branch 'upstream/develop' into feature/annotati…
jgebal Oct 14, 2017
239abde
Add grant ut_annotation_manager to public
pesse Oct 16, 2017
6acd2ad
Add grant ut_annotation_manager to ut3_user
pesse Oct 16, 2017
e114aae
Merge branch 'develop' into feature/annotations_restructuring
jgebal Oct 17, 2017
b83e142
Fixed hardcoded schema-name
jgebal Oct 18, 2017
6dcaae9
Merge remote-tracking branch 'upstream/develop' into feature/annotati…
jgebal Oct 18, 2017
aafca84
Refactored annotation cache.
jgebal Oct 22, 2017
cd394c7
Fixed test execution on 12.1.
jgebal Oct 23, 2017
73c15a2
Merge remote-tracking branch 'upstream/develop' into feature/annotati…
jgebal Oct 23, 2017
5967a3a
Fixed test execution on 12.1.
jgebal Oct 23, 2017
1438753
Merge branch 'develop' into feature/annotations_restructuring
jgebal Oct 24, 2017
4f5d870
Merge conflicts cleanup
jgebal Oct 24, 2017
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
5 changes: 3 additions & 2 deletions development/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ drop user ${UT3_USER} cascade;
begin
for i in (
select decode(owner,'PUBLIC','drop public synonym "','drop synonym "'||owner||'"."')|| synonym_name ||'"' drop_orphaned_synonym from dba_synonyms a
where not exists (select null from dba_objects b where a.table_name=b.object_name and a.table_owner=b.owner )
and a.table_owner <> 'SYS'
where not exists (select 1 from dba_objects b where (a.table_name=b.object_name and a.table_owner=b.owner or b.owner='SYS' and a.table_owner=b.object_name) )
and a.table_owner not in ('SYS','SYSTEM')
) loop
dbms_output.put_line(i.drop_orphaned_synonym);
execute immediate i.drop_orphaned_synonym;
end loop;
end;
Expand Down
23 changes: 23 additions & 0 deletions docs/userguide/annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,26 @@ When processing the test suite `test_pkg` defined in [Example of annotated test
rollback to savepoint 'beforeall'

```

# Annotation cache

utPLSQL needs to scan sources of package specifications to identify and parse annotations.
To improve framework startup time, specially when dealing with database users owning large amount of packages the framework has build-in persistent cache for annotations.

Cache is checked for staleness and refreshed automatically on every run.
The initial startup of utPLSQL for a schema will take longer than consecutive executions.

If you're in situation, where your database is controlled via CI/CD server and gets refreshed/wiped before each run of your tests,
consider building upfront and creating the snapshot of our database after the cache was refreshed.

To build annotation cache without actually invoking any tests, call `ut_runner.rebuild_annotation_cache(a_object_owner, a_object_type)` sql block for every unit test owner that you want to have annotations cache prebuilt.

Example:
```sql
exec ut_runner.rebuild_annotation_cache('HR', 'PACKAGE');
```

To purge annotations cache call:
```sql
exec ut_runner.purge_cache('HR', 'PACKAGE');
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ set echo off
@@tst_pkg_huge.pks

declare
l_suite ut_logical_suite;
l_suites ut_suite_items;
begin
l_suite := ut_suite_manager.config_package(a_owner_name => USER,a_object_name => 'TST_PKG_HUGE');
l_suites := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(USER||'.TST_PKG_HUGE'));
end;
/

Expand Down
23 changes: 6 additions & 17 deletions old_tests/RunAll.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ spool RunAll.log
--Global setup
@@helpers/ut_example_tests.pks
@@helpers/ut_example_tests.pkb
@@helpers/check_annotation_parsing.prc
--@@helpers/cre_tab_ut_test_table.sql
create table ut$test_table (val varchar2(1));
@@helpers/ut_transaction_control.pck
Expand All @@ -38,19 +37,6 @@ create table ut$test_table (val varchar2(1));
--Regular coverage excludes the framework
exec ut_coverage.coverage_start_develop();

@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.IgnoreWrappedPackageAndDoesNotRaiseException.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationMixedWithWrongBeforeProcedure.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationNotBeforeProcedure.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationParamsWithBrackets.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageAndProcedureLevelAnnotations.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotation.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationAccessibleBy.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationMultilineDeclare.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationWithKeyValue.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationWithMultilineComment.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.spaceBeforeAnnotationParams.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationWithWindowsNewline.sql
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseProcedureAnnotationWithVeryLongName.sql
@@lib/RunTest.sql ut_expectation_processor/who_called_expectation.parseStackTrace.sql
@@lib/RunTest.sql ut_expectation_processor/who_called_expectation.parseStackTraceWith0x.sql
@@ut_expectations/ut.expect.not_to_be_null.sql
Expand Down Expand Up @@ -284,7 +270,6 @@ spool off
--Global cleanup
--removing objects that should not be part of coverage report
drop package ut_example_tests;
drop procedure check_annotation_parsing;
drop package ut_transaction_control;
drop table ut$test_table;
drop type department$;
Expand Down Expand Up @@ -341,8 +326,12 @@ begin
'source/api/ut_runner.pks',
'source/core/coverage',
'source/core/types',
'source/core/ut_annotations.pkb',
'source/core/ut_annotations.pks',
'source/core/annotations/ut_annotation_manager.pkb',
'source/core/annotations/ut_annotation_manager.pks',
'source/core/annotations/ut_annotation_parser.pkb',
'source/core/annotations/ut_annotation_parser.pks',
'source/core/annotations/ut_annotation_cache_manager.pkb',
'source/core/annotations/ut_annotation_cache_manager.pks',
'source/core/ut_expectation_processor.pkb',
'source/core/ut_expectation_processor.pks',
'source/core/ut_file_mapper.pkb',
Expand Down
70 changes: 0 additions & 70 deletions old_tests/helpers/check_annotation_parsing.prc

This file was deleted.

1 change: 1 addition & 0 deletions old_tests/helpers/test_reporters.pks
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ create or replace package test_reporters
as
--%suite(A suite for testing different outcomes from reporters)
--%suitepath(org.utplsql.utplsql.test)

--%beforeall
procedure beforeall;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading