osscar-org / scicode-widgets

A collection of widgets to prepare interactive scientific visualisations, including user code input and validation
https://osscar-org.github.io/scicode-widgets/
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Add coverage #18

Closed agoscinski closed 1 year ago

agoscinski commented 1 year ago

One big problem with the coverage is that the tests for the widgets are not recorded by the coverage. First I thought this is just because they are executed within a subprocess for which coverage has a solution https://coverage.readthedocs.io/en/latest/subprocess.html, but it is actually more related to how python code is executed in a notebook. There exist a package pytest-notebook that supports coverage for notebooks, but I could not get it merge with our framework without much extra effort. In the end it also cannot record the code that is executed when using selenium to pass user interactions (e.g. button clicks), because it uses nbclient that runs the notebook a different execution context (which AFAIK does not really load UI elements). So I will just run the python scripts that are converted to notebooks that does the same job and is much simpler. I still need to figure to which degree I add exclude patterns to coverage, because the on_click actions cannot be recorded coverage. If all functions that are used for such interactions have a standardized name we can exclude them very easily. I need still to check this.


:books: Documentation preview :books:: https://scicode-widgets--18.org.readthedocs.build/en/18/

codecov-commenter commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@ca3e017). Click here to learn what that means. Patch has no changes to coverable lines.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #18 +/- ## ======================================= Coverage ? 81.75% ======================================= Files ? 8 Lines ? 411 Branches ? 0 ======================================= Hits ? 336 Misses ? 75 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.