-
Notifications
You must be signed in to change notification settings - Fork 185
Feature/reporters object model fix #589
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
Conversation
… use reporter to get the output data. Introduced new abstract type: `ut_output_reporter_base`. Every reporter based on that type is supposed to use output buffer. So for every reporter of type `ut_output_reporter_base`, client can call functions: - get_lines - lines_to_dbms_output - get_lines_cursor Also, the reporters don't need to call parent reporter's method to finalize the reporting. New finalize event is added. There is no direct dependency between `ut_runner.run` and `ut_output_buffer` so we may now pass a reporter that doesn't report to output but saves data to table for example. Removed unused code. Added unit tests for better coverage. Refactored `ut_output_buffer` package into `ut_output_table_buffer` type. Created base type for output_buffers. Created header table for table output data. Updated `ut_output_reporter_base` to contain by default `ut_output_table_buffer` Updated tests for output buffers. Refreshed list of sources for RunAll script. Addressed review comments and fixed tests stability. Removing initialization from output constructor Fixed buffer initialization. Fixed tests location after rebase.
# Conflicts: # examples/demo_of_expectations/demo_equal_matcher.sql # old_tests/RunAll.sql # old_tests/ut_expectations/ut.expect.to_equal.cursor.SupportsSQLandPLSQLdatatypes.sql # old_tests/ut_output_buffer/send_line.DoesNotSendLineIfNullReporterIdGiven.sql # source/api/ut.pkb # source/api/ut_runner.pkb # source/core/output_buffers/ut_output_buffer_tmp.sql # source/core/ut_output_buffer.pkb # source/core/ut_output_buffer.pks # source/reporters/ut_documentation_reporter.tpb
Let me know when you're good to go on java |
This is for we need to re-instantiate the Output-Buffer from java-api. If we provide an output_id it should just "append" to the existing output-buffer.
Closes #592 |
Closes #391 |
This PR will break java-api, so we cannot merge it until changes are implemented on java side. |
The list should return all known Reporters and information about whether the reporter is an output reporter or not
With that addition to every reporter implementation we can easily create documentation or help-functions for consuming applications like cli. We also encourage third party reporter-providers to give a description about their reporter.
…s_object_model_fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the description of reporter implemented in the reporter itself - neat!
@@ -72,7 +72,8 @@ exec ut_coverage.coverage_start_develop(); | |||
@@lib/RunTest.sql ut_metadata/ut_metadata.form_name.TrimStandaloneProgramName.sql | |||
|
|||
@@lib/RunTest.sql ut_output_buffer/get_lines.RecievesALineFromBufferTableAndDeletes.sql | |||
@@lib/RunTest.sql ut_output_buffer/send_line.DoesNotSendLineIfNullReporterIdGiven.sql | |||
@@lib/RunTest.sql ut_output_buffer/get_lines.WaitsForMoreDataToAppearForSpecifiedTime.sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The work on this PR was initially started before switch to self-testing.
Would you be able to rewrite some of those tests to use new formula (utPLSQL v3 self-testing)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to, but will work on java-api before. That's something we can change after 3.1.0 as part of refactoring, can't we?
overriding member function get_description return varchar2 as | ||
begin | ||
return 'Generates a JSON coverage report providing information on code coverage with line numbers.' || chr(10) || | ||
'Designed for [SonarQube](https://about.sonarqube.com/) to report coverage.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add line:
JSON format returned conforms with the Sonar specification: https://docs.sonarqube.org/display/SONAR/Generic+Test+Data
overriding member function get_description return varchar2 as | ||
begin | ||
return 'Generates a JSON coverage report providing information on code coverage with line numbers.' || chr(10) || | ||
'Designed for [Coveralls](https://coveralls.io/).'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add link:
JSON format conforms with specification: https://docs.coveralls.io/api-introduction
@@ -97,5 +97,11 @@ create or replace type body ut_sonar_test_reporter is | |||
self.print_text('</testExecutions>'); | |||
end; | |||
|
|||
overriding member function get_description return varchar2 as | |||
begin | |||
return 'Generates a JSON report providing detailed information on test execution.' || chr(10) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add line:
JSON format returned conforms with the Sonar specification: https://docs.sonarqube.org/display/SONAR/Generic+Test+Data
@@ -113,5 +113,10 @@ create or replace type body ut_teamcity_reporter is | |||
|
|||
end; | |||
|
|||
overriding member function get_description return varchar2 as | |||
begin | |||
return 'For reporting live progress of test execution with Teamcity CI.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As described in documentation: https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity
@@ -130,5 +129,10 @@ create or replace type body ut_xunit_reporter is | |||
|| '" time="' || ut_utils.to_xml_number_format(a_item.execution_time()) || '" '; | |||
end; | |||
|
|||
overriding member function get_description return varchar2 as | |||
begin | |||
return 'Used for reporting test results with CI servers like Jenkins/Hudson/Teamcity.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provides outcomes in a format conforming with JUnit 4 and above as defined in: https://gist.github.com/kuzuha/232902acab1344d6b578
@@ -0,0 +1,17 @@ | |||
--Arrange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those tests should be moved to utPLSQL v3 test pacakges.
…s_object_model_fix
…s_object_model_fix
This will break cli and java-api
Don't merge before utPLSQL/utPLSQL-java-api#45 is finished (I'm actually working on it)
ut_output_buffer
is now fully abstracted from caller and caller can…… use reporter to get the output data.
Introduced new abstract type:
ut_output_reporter_base
.Every reporter based on that type is supposed to use output buffer.
So for every reporter of type
ut_output_reporter_base
, client can call functions:Also, the reporters don't need to call parent reporter's method to finalize the reporting.
New finalize event is added.
There is no direct dependency between
ut_runner.run
andut_output_buffer
so we may now pass a reporter that doesn't report to output but saves data to table for example.Removed unused code. Added unit tests for better coverage.
Refactored
ut_output_buffer
package intout_output_table_buffer
type.Created base type for output_buffers.
Created header table for table output data.
Updated
ut_output_reporter_base
to contain by defaultut_output_table_buffer
Updated tests for output buffers.
Refreshed list of sources for RunAll script.
Addressed review comments and fixed tests stability.
Removing initialization from output constructor
Fixed buffer initialization.
Fixed tests location after rebase.