Skip to content
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

Run tests with code coverage #102

Closed
jgebal opened this issue May 22, 2020 · 2 comments · Fixed by #105
Closed

Run tests with code coverage #102

jgebal opened this issue May 22, 2020 · 2 comments · Fixed by #105
Assignees
Milestone

Comments

@jgebal
Copy link
Member

jgebal commented May 22, 2020

Currently utPLSQL can be invoked in two ways:

  • run tests
  • run coverage
    Ideally it should be:
  • run tests
  • run tests with coverage

So that:

  • test runner and test run progress is always visible
  • coverage can be inspected alongside test run

The option to run tests with coverage could replace current coverage menu option.

It would be great to be able to run tests with coverage from test runner UI. A new button next to run button could facilitate that.

@PhilippSalvisberg
Copy link
Member

You're right @jgebal. It does make much more sense this way, since code coverage is always executing tests.

@PhilippSalvisberg PhilippSalvisberg added this to the v1.2.0 milestone May 29, 2020
@PhilippSalvisberg
Copy link
Member

PhilippSalvisberg commented May 30, 2020

Starting Position

The realtime reporter requires utPLSQL version 3.1.4 or later. This SQL Developer extension is designed to work with every utPLSQL 3 version. You can disable the realtime reporter in the preferences and then utPLSQL is called via a worksheet and the result is shown in the script output pane (result extracted from DBMS_OUTPUT). In this scenario it does not make sense to run utPLSQL with the code coverage reporter. It's doable, but it is most probably unwanted to have the code coverage HTML code also presented in the script output pane.

The code coverage reporter has the three optional parameters. a_coverage_schemes, a_include_objects and a_exclude_objects. These parameters can be defined in the "Code coverage report" dialog. Even if the default values are good, it is sometimes necessary to amend the values.

When running the code coverage reporter, the "Code coverage report" dialog stays open, so you can press the "Cancel" button to abort the run.

This "Code coverage report" dialog is still useful/necessary.

Solution Approach

I plan to do the following:

1. Code Coverage... in context menu of connections window and editor

If the realtime reporter is enabled, the code coverage runs there. The "Code coverage dialog" closes as soon as the report is started (no cancel option anymore). At the end of the run the code coverage report is extracted and shown in the default browser.

If the realtime reporter is not enabled, then the code coverage behaves as in the current version 1.1.1.

2. Add Code Coverage button in realtime reporter

"Code coverage dialog" is shown for all tests. Dialog works as described above.

3 Add Code Coverage... in context menu of realtime reporter

"Code coverage dialog" is shown for selected tests. Dialog works as described above.

Assessment

This solution approach is not exactly what @jgebal proposed, but it behaves the same way. The main difference is, that the context menu item Code Coverage... is not renamed to Run utPLSQL test with code coverage....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants