-
Notifications
You must be signed in to change notification settings - Fork 185
Add reporting for SQLDeveloper extension #795
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
Comments
The discussed idea was to use JUnit XML format to provide information at individual test level. The trouble with that approach however is that:
An alternative format could be used, but that would probably need to be a custom one. @PhilippSalvisberg - con you provide some thoughts on this? |
I think we can simplify the problem. From my point of view the new annotation API (available since 3.1.3) provides everything to get the scope of the units to be tested. Based on that the GUI can produce a tree based on the included test suites. So bullet point 2 is not relevant for this issue. Technically I would run the tests in connection a and catch the output in connection b. It would be possible to parse the output in connection b and associate it to the nodes in the tree. It is ugly because I would rely on a current output format. Hence I think it must be another reporter with a well defined format. - I'd like to reuse an existing reporter if possible to reduce the maintenance effort in the utPLSQL core. I said in slack that I do not like the idea of parsing XML fragments. However, it's better than parsing DBMS_OUTPUT lines. I suggest to suspend working on this issue until I have done some tests with the existing reporters. Maybe I get what I want with one or a combination of some existing reporters. Chances are good that the functionality in the SQL Developer extensions can be built based on the existing core API. |
@jgebal You can assign this issue to me, if you want. |
I've implemented a Links to the
Links to the tests for
I've also extended all installation scripts to cover this new reporter and amended a test covering a list of all core reporters ( Here is a video showing a producer and consumer using the ut_realtime_reporter via SQL*Plus: https://www.youtube.com/watch?v=80BMojrdCDk I plan to submit a PR as soon as @jgebal and @pesse agree on the solution approach. |
Hi this just an observation - there’s XML format generation logic in here. Any thoughts about extracting this out and using a template engine to isolate the presentation logic? I say this not knowing if there is a decent template engine for plsql (velocity is a Java example). This might be another responsibility we could isolate across utPLSQL and crest a separate capability. |
Yes, @mathewbutler there is potential to extract and isolate XML related logic (e.g in Regarding template engines. There are two I know, which are running within an Oracle Database 11.2, 12.1, 12.2, 18.4. I used them within oddgen. Both work quite nicely. Nonetheless I'd think twice before introducing additional dependencies. It increases complexity. You should be sure that the additional effort has some real benefits. Some additional, related thoughts: An utPLSQL reporter currently produces lines. A line is limited to 4000 bytes. What I would like to have is a mechanism to produce events instead of lines. A payload of such an event should not be limited to a number of bytes. The format of an event could be XML, JSON or something else. An option could be to implement an additional
Each of these events would produce a own and complete document (e.g. XML). An event would be technically transported within a single row. This would simplify things for the consuming clients. Right now the @jgebal and I agreed that we do the first iteration based on the current utPLSQL reporter capabilities. And then - based on the knowledge gained during the implementation of the client code - decide on the next steps. One reason more, to separate the request regarding the introduction of a template engine and/or XML library in utPLSQL. |
@PhilippSalvisberg Here are my comments:
tests I love the way you've implemented the tests taking benefit for Oracle's build-in functionality for XML processing. One comment about test descriptions. Implementation Each call to
If you want to go with l_lines ut_varchar2_list;
begin
if a_clob is not null and dbms_lob.getlength(a_clob) > 0 then
l_lines := ut_utils.clob_to_table(a_clob);
for i in 1 .. l_lines.count loop
self.print_text(l_lines(i));
end loop;
end if;
end; Will be far more performant to use begin
if a_clob is not null and dbms_lob.getlength(a_clob) > 0 then
self.print_text_lines(
ut_utils.convert_collection( ut_utils.clob_to_table( a_clob, 4000 ) )
);
end if;
end; |
Now that I think of it... |
@PhilippSalvisberg Agree with your points;
As framed, this was an observation, rather that a review comment. Really something I thought about skimming the code. Love the idea of event based / Observer implementation for this. I’m not clear yet how this will be tested, and think this will also draw out some useful new capabilities for utPLSQL . Also,like the idea of iterating on this as a way to inform the final design. It’ll be interesting to watch this evolve. |
Thank you, @jgebal for your input. I like the idea of describing the requirement instead of the test itself. However, I found it difficult to apply it. I probably need some more practice here... 😂. I've changed the test specification as suggested. And I'm using now So the question is. Do we want to produce multiple XML documents now? |
Would you like the output buffer to return more than just data column (as it is today). Example: That could be of use for cli & html coverage reporter though instead of event we would serve item name/type. |
I can imagine that an additional column such as |
I suggest the following:
This issue #755 should cover number 1 only. Based on that I can implement utPLSQL/utPLSQL-SQLDeveloper#6 as well. This would be a huge improvement, since right now this enhancement is not implementable using existing reporters in SQLDev. For number 2 and 3 dedicated issues should be opened. |
We can create a new output buffer with CLOB & item_type.
This shouldn't be much of a hustle. I can take that challenge. @PhilippSalvisberg - To make you progress without the new reporter, use the |
Ok, I rewrite the |
@jgebal: Using
|
That will need to be fixed inside the method. Also, can you work on utPLSQL repo directly? We could the collaborate on that feature branch. I'll add you to team. |
Resolved by #809 |
As a SQLDeveloper user, I'd like to get pretty and interactive reports from my SQLDeveloper test-runs so that I can:
In order to support all of those requirements, as separate reporter is needed.
The text was updated successfully, but these errors were encountered: