8000 Changed ordering of tests for suites with context by jgebal · Pull Request #1037 · utPLSQL/utPLSQL · GitHub
[go: up one dir, main page]

Skip to content

Changed ordering of tests for suites with context #1037

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 3 commits into from
Jan 4, 2020
Merged
Changes from 1 commit
Commits
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
Added documenting comments for ordering of data from suite_cache.
Fixed SQL formatting.
  • Loading branch information
jgebal committed Jan 3, 2020
commit 326e055007b38fc3ec3380aaae86483f6cb21579
8 changes: 6 additions & 2 deletions source/core/ut_suite_cache_manager.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,23 @@ create or replace package body ut_suite_cache_manager is
return case
when a_random_seed is null then q'[
replace(
--suite path until objects name (excluding contexts and test path) with trailing dot (full stop)
substr( c.obj.path, 1, instr( c.obj.path, lower(c.obj.object_name), -1 ) + length(c.obj.object_name) ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this very hard to read/understand. I guess extracting to a helper function would be too much overhead - can we add a comment to explain the intention?
-- get path until object's name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is documented properly now.
Thanks for this comment. It helps me a lot to see what is not obvious/clear.

'.',
--'.' replaced with chr(0) to assure that child elements come before parent when sorting in descending oder
chr(0)
) desc nulls last,
case when c.obj.self_type = 'UT_SUITE_CONTEXT' then
( select max( x.line_no ) + 1
from ut_suite_cache x
where c.obj.object_owner = x.object_owner and c.obj.object_name = x.object_name and
x.path like c.obj.path || '.%'
where c.obj.object_owner = x.object_owner
and c.obj.object_name = x.object_name
and x.path like c.obj.path || '.%'
)
else
c.obj.line_no
end,
--assures that child contexts come before parent contexts
regexp_count(c.obj.path,'\.') desc,
:a_random_seed]'
else
Expand Down
0