-
Notifications
You must be signed in to change notification settings - Fork 186
Add a section on custom reporters. #1225
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
docs/userguide/reporters.md
Outdated
# Custom reporters | ||
|
||
It is possible to add your own reporters by creating an appropriate object type. In principle, it has to be a subtype of `ut_reporter_base`. However, in most cases, it is more convenient to create the custom reporter type under a more specialized type, like `ut_documentation_reporter` or `ut_junit_reporter`, and override just some of the functionality. |
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.
We need to distinguish between ut_reporter_base
which is a foundation for any reporter and
ut_output_reporter_base
which should be used as a base for reporter that is expected to produce output consumable by client (screen/file) outside of database.
Currently, all reporters in utPLSQL framework provide outputs to customer
If however you would like to create a reporter that saves data to a DB table for example, you should use ut_reporter_base
utPLSQL will behave differently based on what type they are build on.
For reporters built on ut_output_reporter_base
utPLSQL will consume output of the reporter and put it to screen before finishing the ut.run()
call. For reporters not based on that type, output will not be consumed.
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.
You could build a reporter based on ut_console_reporter_base
if you would like to produce a text output from reporter in different colors
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.
Good points, thanks for the review. I'll improve the paragraph as suggested. I hope to do it over the weekend, but can't promise anything. I'm also going to mention where the core reporter types can be found in the repo.
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.
Thanks Michał
I rally know how difficult it can be to find time & space to spend on writing some code outside of your da-to-day work. We appreciate all, even smallest contributions. They really make a difference.
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.
@jgebal I force-pushed an updated version. I wasn't 100% sure what you meant by "For reporters built on ut_output_reporter_base utPLSQL will consume output of the reporter and put it to screen before finishing the ut.run() call. For reporters not based on that type, output will not be consumed.", so I didn't include this remark.
@kukimik Thank you for contributions |
Thank you for the contribution @kukimik I have added a suggestion to make the doc even better. |
@jgebal I try to contribute to the open source projects that I use. For me it's both a way to get better understanding of the tool, and to say "thank you" to the authors/maintainers. |
32c6fd8
to
53dc4d8
Compare
Resolves #701 |
Custom reporters are mentioned in a few places in the docs. Also,
README.md
lists "plugin architecture for reporters and matchers" as one of the key features. But there is no section in the docs that actually describes how to add a custom reporter. I believe that this short description of the process may be useful (it would be useful for me).Sorry - I didn't have time to build the website and check if it looks ok, but I don't see why it wouldn't. (I've had a revolution in my family life in the last few months, and now I hardly have time for anything)
I decided not to describe the necessary grants when the custom reporter is created outside of the
UT3
schema. I state that this is not recommended, If someone wants to follow this path, let them do it at their own risk. Also, I'm not able to check it in different DB versions.