Skip to content

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

Merged
merged 26 commits into from
Mar 8, 2018
Merged

Conversation

pesse
Copy link
Member

@pesse pesse commented Feb 14, 2018

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:

  • 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.

jgebal and others added 5 commits October 18, 2017 00:11
… 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
@jgebal
Copy link
Member

jgebal commented Feb 14, 2018

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.
@pesse
Copy link
Member Author

pesse commented Feb 28, 2018

Closes #592

@pesse
Copy link
Member Author

pesse commented Feb 28, 2018

Closes #391

@jgebal
Copy link
Member

jgebal commented Mar 1, 2018

This PR will break java-api, so we cannot merge it until changes are implemented on java side.

@jgebal jgebal added this to the v3.1.0 milestone Mar 1, 2018
pesse added 5 commits March 4, 2018 14:28
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.
Copy link
Member

@jgebal jgebal left a 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
Copy link
Member

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)?

Copy link
Member Author

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.';
Copy link
Member

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/).';
Copy link
Member

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) ||
Copy link
Member

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.';
Copy link
Member

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.';
Copy link
Member

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
Copy link
Member

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.

@pesse pesse merged commit d3b034d into develop Mar 8, 2018
@jgebal jgebal deleted the feature/reporters_object_model_fix branch March 27, 2018 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants