10000 Release/v3.1.10 by jgebal · Pull Request #1048 · utPLSQL/utPLSQL · GitHub
[go: up one dir, main page]

Skip to content

Release/v3.1.10 #1048

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

Merged
merged 61 commits into from
Feb 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1f1828f
Updated project version to 3.1.10
jgebal Nov 10, 2019
a33b53d
Updated project version after build [skip ci]
Nov 10, 2019
a2c0a58
Update link for utPLSQL download statistics
jgebal Nov 10, 2019
52794ac
Updated project version after build [skip ci]
Nov 10, 2019
b3973d0
Fixed test dependency on user running them.
jgebal Nov 29, 2019
39d144a
Changed how savepoint name is generated.
jgebal Nov 30, 2019
4bb7a95
Added a hash of owner to the generated savepoint name.
jgebal Nov 30, 2019
f7f9692
Merge pull request #1027 from utPLSQL/feature/minor_test_fixes
jgebal Nov 30, 2019
42053b4
Updated project version after build [skip ci]
Nov 30, 2019
d654ccc
Changed the target location for published documentation.
jgebal Dec 1, 2019
090b74c
Updated project version after build [skip ci]
Dec 1, 2019
e8f4532
Skip as many %endcontext as nested %context annotations
pesse Dec 19, 2019
8df3f7d
Refactoring: Extract function, add variables for readability
pesse Dec 19, 2019
a4d92de
Refactoring: Add clarifying comment
pesse Dec 19, 2019
4d1500f
Refactoring: Move responsibility to get context name completely to ge…
pesse Dec 19, 2019
3c547ec
Fix intendation
pesse Dec 20, 2019
b4c1d72
Refactoring: Use just one return to improve readability
pesse Dec 20, 2019 8000
86185a8
Rewrite get_endcontext_position to be much easier to understand
pesse Dec 20, 2019
89df1dd
Clarify intention of end-position, make it more visible how it's defined
pesse Dec 20, 2019
c61abfa
Get rid of several `in out nocopy` params where `in` would be sufficient
pesse Dec 20, 2019
35acf14
Not necessary to check for IS NOT NULL
pesse Dec 20, 2019
3327fc3
Fix intendation
pesse Dec 20, 2019
587f966
Merge pull request #1035 from utPLSQL/bugfix/nested_context_mixup
jgebal Dec 20, 2019
cef109b
Updated project version after build [skip ci]
Dec 20, 2019
ad0f99d
Fixed repo for publishing github docs.
jgebal Dec 22, 2019
33f5152
Updated project version after build [skip ci]
Dec 22, 2019
8e43a08
Moved validation of `--%throws` annotation values.
jgebal Dec 29, 2019
d33bd80
Updated documentation for whitespace vs null compare.
jgebal Jan 2, 2020
5510555
Fixed documentation.
jgebal Jan 3, 2020
4dea559
Merge pull request #1038 from utPLSQL/bugfix/throws_exceptions_list_p…
jgebal Jan 3, 2020
d02ac94
Changed ordering of tests for suites with context
jgebal Dec 29, 2019
0a4edaf
Test name fix
jgebal Dec 29, 2019
326e055
Added documenting comments for ordering of data from suite_cache.
jgebal Jan 3, 2020
a25b8b7
Updated project version after build [skip ci]
Jan 3, 2020
d708443
Fixed documentation typos.
jgebal Jan 4, 2020
8f38487
Merge pull request #1039 from utPLSQL/feature/update_docs_for_whitesp…
jgebal Jan 4, 2020
d9077a1
Merge pull request #1037 from utPLSQL/feature/test_ordering
jgebal Jan 4, 2020
101bcbf
Updated project version after build [skip ci]
Jan 4, 2020
1b0b8f8
Refactored expectations on compound data
jgebal Feb 15, 2020
8eac19e
Changed maven repo url.
jgebal Feb 15, 2020
d84a684
Removing maven step for obtaining Oracle jdbc drivers - those are now…
jgebal Feb 15, 2020
02ba32b
Removing `/dev/pdbs` directory
jgebal Feb 15, 2020
7363daa
Merge pull request #1044 from utPLSQL/feature/fix_maven_url
jgebal Feb 15, 2020
15d24af
Updated project version after build [skip ci]
Feb 15, 2020
ba90abf
Cleanup and refactoring of annotation cache.
jgebal Aug 5, 2019
335e420
Fixed loophole in privilege check.
jgebal Nov 12, 2019
94f9c43
Merge remote-tracking branch 'origin/develop' into feature/unify_curs…
jgebal Feb 15, 2020
054c39f
Fixed issues with new cursor-results compare query on 11g
jgebal Feb 16, 2020
b39c5be
Added additional tests for annotation cache refresh with/without DDL …
jgebal Feb 17, 2020
5eab4aa
Fixed Teamcity reporting of errors
jgebal Feb 18, 2020
641b3b4
Update install.sh
jgebal Feb 18, 2020
67c4e78
Update test_teamcity_reporter.pkb
jgebal Feb 18, 2020
9c4333e
Merge pull request #1046 from utPLSQL/feature/teamcity_error_reportin…
jgebal Feb 18, 2020
3c0351f
Updated project version after build [skip ci]
Feb 18, 2020
4bed0c4
Merge pull request #1043 from utPLSQL/feature/unify_cursor_compare_be…
jgebal Feb 18, 2020
29b6db4
Updated project version after build [skip ci]
Feb 18, 2020
5d4c33c
Removed unneeded `is_annotated` column
jgebal Feb 22, 2020
62f3154
Merge pull request #986 from utPLSQL/feature/cache_fixes
jgebal Feb 23, 2020
8e54873
Updated project version after build [skip ci]
Feb 23, 2020
a2d1638
Update `releasing.md` file
jgebal Feb 23, 2020
9034250
Updated project version after build [skip ci]
Feb 23, 2020
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
Skip as many %endcontext as nested %context annotations
We need to make sure to calculate the corrent %endcontext annotation, not just the first that is greater than the next nested %context.
To operate correctly during recursion we also need information about the parent %endcontext position

Fixes #1034
  • Loading branch information
pesse committed Dec 19, 2019
commit e8f453291b58f90bde2fbac6a6b8562757997905
56 changes: 46 additions & 10 deletions source/core/ut_suite_builder.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -708,15 +708,49 @@ create or replace package body ut_suite_builder is
a_context_ann_pos t_annotation_position,
a_package_annotations in out nocopy tt_annotations_by_name
) return t_annotation_position is
l_result t_annotation_position;
l_next_endcontext_pos t_annotation_position;
l_next_context_pos t_annotation_position;
l_open_count integer := 0;
begin
if a_package_annotations.exists(gc_endcontext) then
l_result := a_package_annotations(gc_endcontext).first;
while l_result <= a_context_ann_pos loop
l_result := a_package_annotations(gc_endcontext).next(l_result);
l_next_endcontext_pos := a_package_annotations(gc_endcontext).first;
while l_next_endcontext_pos <= a_context_ann_pos loop
l_next_endcontext_pos := a_package_annotations(gc_endcontext).next(l_next_endcontext_pos);
end loop;

l_next_context_pos := a_package_annotations(gc_context).next(a_context_ann_pos);
loop
-- Get all the %context annotations between start and first %endcontext
while l_next_context_pos is not null and l_next_context_pos < l_next_endcontext_pos loop
l_open_count := l_open_count+1;
l_next_context_pos := a_package_annotations(gc_context).next(l_next_context_pos);
end loop;
-- Skip as many %endcontexts as we had additional contexts open
while l_open_count > 0 loop
l_open_count := l_open_count-1;
l_next_endcontext_pos := a_package_annotations(gc_endcontext).next(l_next_endcontext_pos);
end loop;
-- Repeat until the next %context is later than next %endcontext
exit when l_next_context_pos is null or l_next_context_pos > l_next_endcontext_pos;
end loop;
end if;
return l_result;
return l_next_endcontext_pos;
end;

function has_nested_context(
a_context_ann_pos t_annotation_position,
a_package_annotations in out nocopy tt_annotations_by_name
) return boolean is
l_next_endcontext_pos t_annotation_position;
begin
if ( a_package_annotations.exists(gc_endcontext) and a_package_annotations.exists(gc_context)) then
l_next_endcontext_pos := a_package_annotations(gc_endcontext).first;
while l_next_endcontext_pos <= a_context_ann_pos loop
l_next_endcontext_pos := a_package_annotations(gc_endcontext).next(l_next_endcontext_pos);
end loop;
return l_next_endcontext_pos > a_package_annotations(gc_context).next(a_context_ann_pos);
end if;
return false;
end;

function get_annotations_in_context(
Expand Down Expand Up @@ -753,7 +787,8 @@ create or replace package body ut_suite_builder is
a_parent in out nocopy ut_suite,
a_annotations in out nocopy t_annotations_info,
a_suite_items out nocopy ut_suite_items,
a_parent_context_pos in integer := 0
a_parent_context_pos in integer := 0,
a_parent_end_context_pos in integer default null
) is
l_context_pos t_annotation_position;
l_next_context_pos t_annotation_position;
Expand Down Expand Up @@ -802,7 +837,6 @@ create or replace package body ut_suite_builder is
l_default_context_name := 'nested_context_#'||l_context_no;
l_context_name := null;
l_end_context_pos := get_endcontext_position(l_context_pos, a_annotations.by_name );

l_next_context_pos := a_annotations.by_name(gc_context).next(l_context_pos);
if a_annotations.by_name.exists(gc_name) then
l_context_name :=
Expand Down Expand Up @@ -841,9 +875,8 @@ create or replace package body ut_suite_builder is
l_context.parse_time := a_annotations.parse_time;

--if nested context found
if l_next_context_pos < l_end_context_pos or l_end_context_pos is null then
get_context_items( l_context, a_annotations, l_context_items, l_context_pos );
l_end_context_pos := get_endcontext_position(l_context_pos, a_annotations.by_name );
if has_nested_context(l_context_pos, a_annotations.by_name) then
get_context_items( l_context, a_annotations, l_context_items, l_context_pos, l_end_context_pos );
else
l_context_items := ut_suite_items();
end if;
Expand All @@ -870,6 +903,9 @@ create or replace package body ut_suite_builder is
exit when not a_annotations.by_name.exists( gc_context);

l_context_pos := a_annotations.by_name( gc_context).next( l_context_pos);
if ( a_parent_end_context_pos is not null and a_parent_end_context_pos <= l_context_pos ) then
l_context_pos := null;
end if;
l_context_no := l_context_no + 1;
end loop;
end;
Expand Down
68 changes: 68 additions & 0 deletions test/ut3_tester/core/test_suite_builder.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,74 @@ create or replace package body test_suite_builder is
);
end;

procedure nested_contexts_2 is
l_actual clob;
l_annotations ut3.ut_annotations;
begin
--Arrange
l_annotations := ut3.ut_annotations(
ut3.ut_annotation( 1, 'suite','Cool', null),
ut3.ut_annotation( 2, 'suitepath','path', null),
ut3.ut_annotation( 3, 'context','Level 1', null),
ut3.ut_annotation( 4, 'name','context_1', null),
ut3.ut_annotation( 5, 'context','Level 1.1', null),
ut3.ut_annotation( 6, 'name','context_1_1', null),
ut3.ut_annotation( 7, 'test', 'Test 1.1.1', 'test_1_1_1'),
ut3.ut_annotation( 8, 'test', 'Test 1.1.2', 'test_1_1_2'),
ut3.ut_annotation( 9, 'endcontext', null, null),
ut3.ut_annotation(10, 'endcontext', null, null),
ut3.ut_annotation(11, 'context','Level 2', null),
ut3.ut_annotation(12, 'name','context_2', null),
ut3.ut_annotation(13, 'test', 'Test 2.1', 'test_2_1'),
ut3.ut_annotation(14, 'endcontext',null, null)
);
--Act
l_actual := invoke_builder_for_annotations(l_annotations, 'SOME_PACKAGE');
--Assert
ut.expect(l_actual).to_be_like(
'<ROWSET><ROW>'||
'<UT_LOGICAL_SUITE>' ||
'%<ITEMS>%' ||
'<UT_SUITE_ITEM>' ||
'%<NAME>context_1</NAME><DESCRIPTION>Level 1</DESCRIPTION><PATH>path.some_package.context_1</PATH>' ||
'%<ITEMS>' ||
'<UT_SUITE_ITEM>' ||
'%<NAME>context_1_1</NAME><DESCRIPTION>Level 1.1</DESCRIPTION><PATH>path.some_package.context_1.context_1_1</PATH>' ||
'%<ITEMS>' ||
'<UT_SUITE_ITEM>' ||
'%<NAME>test_1_1_1</NAME><DESCRIPTION>Test 1.1.1</DESCRIPTION><PATH>path.some_package.context_1.context_1_1.test_1_1_1</PATH>' ||
'%</UT_SUITE_ITEM>' ||
'<UT_SUITE_ITEM>' ||
'%<NAME>test_1_1_2</NAME><DESCRIPTION>Test 1.1.2</DESCRIPTION><PATH>path.some_package.context_1.context_1_1.test_1_1_2</PATH>' ||
'%</UT_SUITE_ITEM>' ||
'</ITEMS>' ||
'%<BEFORE_ALL_LIST/>' ||
'%</UT_SUITE_ITEM>' ||
'</ITEMS>' ||
'%</UT_SUITE_ITEM>' ||
'%</ITEMS>' ||
'%</UT_LOGICAL_SUITE>'||
'</ROW></ROWSET>'
);
-- Test both contexts separately due to ordering
ut.expect(l_actual).to_be_like(
'<ROWSET><ROW>'||
'<UT_LOGICAL_SUITE>' ||
'%<ITEMS>%' ||
'<UT_SUITE_ITEM>' ||
'%<NAME>context_2</NAME><DESCRIPTION>Level 2</DESCRIPTION><PATH>path.some_package.context_2</PATH>' ||
'%<ITEMS>' ||
'<UT_SUITE_ITEM>' ||
'%<NAME>test_2_1</NAME><DESCRIPTION>Test 2.1</DESCRIPTION><PATH>path.some_package.context_2.test_2_1</PATH>' ||
'%</UT_SUITE_ITEM>' ||
'%</ITEMS>' ||
'%</UT_SUITE_ITEM>' ||
'%</ITEMS>' ||
'%</UT_LOGICAL_SUITE>'||
'</ROW></ROWSET>'
);
end;


procedure before_after_in_context is
l_actual clob;
Expand Down
5 changes: 5 additions & 0 deletions test/ut3_tester/core/test_suite_builder.pks
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ create or replace package test_suite_builder is
--%suitepath(utplsql.ut3_tester.core)

--%context(--%suite annotation)
--%name(suite)

--%test(Sets suite name from package name and leaves description empty)
procedure no_suite_description;
Expand Down Expand Up @@ -105,13 +106,17 @@ create or replace package test_suite_builder is
--%endcontext

--%context(--%context annotation)
--%name(context)

--%test(Creates nested suite for content between context/endcontext annotations)
procedure suite_from_context;

--%test(Creates nested contexts inside a context)
procedure nested_contexts;

--%test(Creates multiple nested contexts inside a context)
procedure nested_contexts_2;

--%test(Associates before/after all/each to tests in context only)
procedure before_after_in_context;

Expand Down
0