Skip to content

Commit

Permalink
Removed time_in_suite, time_in_context, time_in_test as they ar…
Browse files Browse the repository at this point in the history
…e of low value and could bing confusion.
  • Loading branch information
jgebal committed Jul 3, 2019
1 parent f5fa468 commit 99bae42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 45 deletions.
24 changes: 3 additions & 21 deletions source/core/session_context/ut_session_info.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,16 @@ create or replace type body ut_session_info as
member procedure before_calling_suite(self in out nocopy ut_session_info, a_suite in ut_logical_suite) is
begin
if a_suite is not of (ut_suite_context) then
suite_start_time := a_suite.start_time;
ut_session_context.set_context( 'suite_path', a_suite.path );
ut_session_context.set_context( 'suite_package', a_suite.object_owner||'.'||a_suite.object_name );
ut_session_context.set_context( 'suite_description', a_suite.description );
ut_session_context.set_context( 'suite_start_time', ut_utils.to_string(suite_start_time) );
ut_session_context.set_context( 'suite_start_time', ut_utils.to_string(a_suite.start_time) );
dbms_application_info.set_module( 'utPLSQL', a_suite.object_name );
else
context_start_time := a_suite.start_time;
ut_session_context.set_context( 'context_name', a_suite.name );
ut_session_context.set_context( 'context_path', a_suite.path);
ut_session_context.set_context( 'context_description', a_suite.description );
ut_session_context.set_context( 'context_start_time', ut_utils.to_string(context_start_time) );
ut_session_context.set_context( 'context_start_time', ut_utils.to_string(a_suite.start_time) );
end if;
end;

Expand All @@ -64,34 +62,27 @@ create or replace type body ut_session_info as
ut_session_context.clear_context( 'suite_path' );
ut_session_context.clear_context( 'suite_description' );
ut_session_context.clear_context( 'suite_start_time' );
ut_session_context.clear_context( 'time_in_suite' );
suite_start_time := null;
else
ut_session_context.clear_context( 'context_name' );
ut_session_context.clear_context( 'context_path' );
ut_session_context.clear_context( 'context_description' );
ut_session_context.clear_context( 'context_start_time' );
ut_session_context.clear_context( 'time_in_context' );
context_start_time := null;
end if;
end;


member procedure before_calling_test(self in out nocopy ut_session_info, a_test in ut_test) is
begin
test_start_time := a_test.start_time;
ut_session_context.set_context( 'test_name', a_test.object_owner||'.'||a_test.object_name||'.'||a_test.name );
ut_session_context.set_context( 'test_description', a_test.description );
ut_session_context.set_context( 'test_start_time', ut_utils.to_string(test_start_time) );
ut_session_context.set_context( 'test_start_time', ut_utils.to_string(a_test.start_time) );
end;

member procedure after_calling_test (self in out nocopy ut_session_info, a_test in ut_test) is
begin
ut_session_context.clear_context( 'test_name' );
ut_session_context.clear_context( 'test_description' );
ut_session_context.clear_context( 'test_start_time' );
ut_session_context.clear_context( 'time_in_test' );
test_start_time := null;
end;

member procedure before_calling_executable(self in out nocopy ut_session_info, a_executable in ut_executable) is
Expand All @@ -102,15 +93,6 @@ create or replace type body ut_session_info as
a_executable.owner_name||'.'||a_executable.object_name||'.'||a_executable.procedure_name
);
dbms_application_info.set_client_info( a_executable.procedure_name );
if suite_start_time is not null then
ut_session_context.set_context( 'time_in_suite', current_timestamp - suite_start_time );
if context_start_time is not null then
ut_session_context.set_context( 'time_in_context', current_timestamp - context_start_time );
end if;
if test_start_time is not null then
ut_session_context.set_context( 'time_in_test', current_timestamp - test_start_time );
end if;
end if;
end;

member procedure after_calling_executable(self in out nocopy ut_session_info, a_executable in ut_executable) is
Expand Down
3 changes: 0 additions & 3 deletions source/core/session_context/ut_session_info.tps
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ create or replace type ut_session_info under ut_event_listener (
module varchar2(4000),
action varchar2(4000),
client_info varchar2(4000),
suite_start_time timestamp,
context_start_time timestamp,
test_start_time timestamp,
constructor function ut_session_info(self in out nocopy ut_session_info) return self as result,

member procedure before_calling_run(self in out nocopy ut_session_info, a_run in ut_run),
Expand Down
21 changes: 0 additions & 21 deletions test/ut3_user/api/test_ut_run.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,6 @@ Failures:%
||'%BEFORE_SUITE:SUITE_PACKAGE='||gc_owner||'.check_context'
||'%BEFORE_SUITE:SUITE_PATH=some.suite.path.check_context'
||'%BEFORE_SUITE:SUITE_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%BEFORE_SUITE:TIME_IN_SUITE=+000000000 00:00:0'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=before_suite%'
Expand All @@ -1187,8 +1186,6 @@ Failures:%
||'%BEFORE_CONTEXT:SUITE_PACKAGE='||gc_owner||'.check_context'
||'%BEFORE_CONTEXT:SUITE_PATH=some.suite.path.check_context'
||'%BEFORE_CONTEXT:SUITE_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%BEFORE_CONTEXT:TIME_IN_CONTEXT=+000000000 00:00:0'
||'%BEFORE_CONTEXT:TIME_IN_SUITE=+000000000 00:00:0'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=before_context%'
Expand All @@ -1213,9 +1210,6 @@ Failures:%
||'%BEFORE_EACH_TEST:TEST_DESCRIPTION=Some test description'
||'%BEFORE_EACH_TEST:TEST_NAME='||gc_owner||'.check_context.the_test'
||'%BEFORE_EACH_TEST:TEST_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%BEFORE_EACH_TEST:TIME_IN_CONTEXT=+000000000 00:00:0%'
||'%BEFORE_EACH_TEST:TIME_IN_SUITE=+000000000 00:00:0%'
||'%BEFORE_EACH_TEST:TIME_IN_TEST=+000000000 00:00:0%'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=before_each_test%'
Expand All @@ -1239,9 +1233,6 @@ Failures:%
||'%BEFORE_TEST:TEST_DESCRIPTION=Some test description'
||'%BEFORE_TEST:TEST_NAME='||gc_owner||'.check_context.the_test'
||'%BEFORE_TEST:TEST_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%BEFORE_TEST:TIME_IN_CONTEXT=+000000000 00:00:0%'
||'%BEFORE_TEST:TIME_IN_SUITE=+000000000 00:00:0%'
||'%BEFORE_TEST:TIME_IN_TEST=+000000000 00:00:0%'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=before_test%'
Expand All @@ -1265,9 +1256,6 @@ Failures:%
||'%THE_TEST:TEST_DESCRIPTION=Some test description'
||'%THE_TEST:TEST_NAME='||gc_owner||'.check_context.the_test'
||'%THE_TEST:TEST_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%THE_TEST:TIME_IN_CONTEXT=+000000000 00:00:0%'
||'%THE_TEST:TIME_IN_SUITE=+000000000 00:00:0%'
||'%THE_TEST:TIME_IN_TEST=+000000000 00:00:0%'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=the_test%'
Expand All @@ -1291,9 +1279,6 @@ Failures:%
||'%AFTER_TEST:TEST_DESCRIPTION=Some test description'
||'%AFTER_TEST:TEST_NAME='||gc_owner||'.check_context.the_test'
||'%AFTER_TEST:TEST_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%AFTER_TEST:TIME_IN_CONTEXT=+000000000 00:00:0%'
||'%AFTER_TEST:TIME_IN_SUITE=+000000000 00:00:0%'
||'%AFTER_TEST:TIME_IN_TEST=+000000000 00:00:0%'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=after_test%'
Expand All @@ -1317,9 +1302,6 @@ Failures:%
||'%AFTER_EACH_TEST:TEST_DESCRIPTION=Some test description'
||'%AFTER_EACH_TEST:TEST_NAME='||gc_owner||'.check_context.the_test'
||'%AFTER_EACH_TEST:TEST_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%AFTER_EACH_TEST:TIME_IN_CONTEXT=+000000000 00:00:0%'
||'%AFTER_EACH_TEST:TIME_IN_SUITE=+000000000 00:00:0%'
||'%AFTER_EACH_TEST:TIME_IN_TEST=+000000000 00:00:0%'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=after_each_test%'
Expand All @@ -1340,8 +1322,6 @@ Failures:%
||'%AFTER_CONTEXT:SUITE_PACKAGE='||gc_owner||'.check_context'
||'%AFTER_CONTEXT:SUITE_PATH=some.suite.path.check_context'
||'%AFTER_CONTEXT:SUITE_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%AFTER_CONTEXT:TIME_IN_CONTEXT=+000000000 00:00:0%'
||'%AFTER_CONTEXT:TIME_IN_SUITE=+000000000 00:00:0%'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=after_context%'
Expand All @@ -1359,7 +1339,6 @@ Failures:%
||'%AFTER_SUITE:SUITE_PACKAGE='||gc_owner||'.check_context'
||'%AFTER_SUITE:SUITE_PATH=some.suite.path.check_context'
||'%AFTER_SUITE:SUITE_START_TIME='||to_char(current_timestamp,'yyyy-mm-dd"T"hh24:mi')
||'%AFTER_SUITE:TIME_IN_SUITE=+000000000 00:00:0%'
||'%APPLICATION_INFO:MODULE=utPLSQL'
||'%APPLICATION_INFO:ACTION=check_context'
||'%APPLICATION_INFO:CLIENT_INFO=after_suite%'
Expand Down

0 comments on commit 99bae42

Please sign in to comment.