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

Integration test coverage #4969

Merged
merged 62 commits into from
May 10, 2023
Merged

Conversation

IgorWounds
Copy link
Contributor

@IgorWounds IgorWounds commented May 4, 2023

This feature allows us to calculate the integration test coverage of the OpenBB Terminal. It obtains each controller and parses its commands and the parameters of each command. Then, it calculates the difference between all available commands and parameters and those that were used inside the integration test scripts.

To allow for this, a naming convention was put in place for the integration test scripts. The tool was used to improve the coverage of existing integration tests and new ones were added.

To obtain the integration test coverage of a single controller write the following:

from openbb_terminal.core.integration_tests.integration_test_coverage import get_coverage_single_controller

get_coverage_single_controller(
    'openbb_terminal.futures.futures_controller',
    '/futures/test_futures.openbb',
    )

Screenshot 2023-05-07 at 21 10 01

To obtain coverage for all controllers do this:

from openbb_terminal.core.integration_tests.integration_test_coverage import get_coverage_all_controllers

get_coverage_all_controllers()

To run the above command from the terminal write:

openbb -t --coverage

At the end of the terminal command run, which tests all controllers, a summary will be printed. This summary is automatically pushed to our Slack on nightly builds via the GitHub Actions workflow.

Note: The submenus that require pre-loaded data (e.g. ta, qa...) have their parameter coverage accuracy hindered due to the controllers not generating choices_default and thus are about 95% accurate.

@reviewpad reviewpad bot added the feat L Large T-Shirt size Feature label May 4, 2023
@IgorWounds IgorWounds added enhancement Enhancement tests Test-related work labels May 4, 2023
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Patch coverage: 61.01% and project coverage change: -0.31 ⚠️

Comparison is base (df9a154) 58.29% compared to head (3a355f2) 57.98%.

❗ Current head 3a355f2 differs from pull request most recent head c067fe8. Consider uploading reports for the commit c067fe8 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4969      +/-   ##
===========================================
- Coverage    58.29%   57.98%   -0.31%     
===========================================
  Files          588      589       +1     
  Lines        53666    53939     +273     
===========================================
- Hits         31283    31275       -8     
- Misses       22383    22664     +281     
Impacted Files Coverage Δ
.../core/plots/plotly_ta/plugins/volatility_plugin.py 31.37% <0.00%> (-1.29%) ⬇️
...inal/core/sdk/controllers/crypto_sdk_controller.py 0.00% <ø> (ø)
...inal/core/sdk/controllers/stocks_sdk_controller.py 0.00% <ø> (ø)
...penbb_terminal/core/sdk/models/crypto_sdk_model.py 0.00% <0.00%> (ø)
...penbb_terminal/core/sdk/models/stocks_sdk_model.py 0.00% <0.00%> (ø)
openbb_terminal/core/sdk/sdk_helpers.py 36.92% <ø> (ø)
openbb_terminal/core/sdk/sdk_init.py 92.75% <ø> (ø)
openbb_terminal/core/sdk/trailmap.py 92.68% <ø> (ø)
openbb_terminal/dashboards/stream/Forecasting.py 0.00% <0.00%> (ø)
...bb_terminal/dashboards/stream/streamlit_helpers.py 0.00% <0.00%> (ø)
... and 38 more

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@IgorWounds IgorWounds force-pushed the feature/integration-test-coverage branch from 3a355f2 to d326b57 Compare May 4, 2023 13:51
@IgorWounds IgorWounds force-pushed the feature/integration-test-coverage branch from 7edb4ac to 1163357 Compare May 7, 2023 19:08
@IgorWounds IgorWounds marked this pull request as ready for review May 8, 2023 13:30
@IgorWounds IgorWounds enabled auto-merge May 9, 2023 20:07
@IgorWounds IgorWounds added this pull request to the merge queue May 10, 2023
Merged via the queue into develop with commit 705a331 May 10, 2023
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement feat L Large T-Shirt size Feature tests Test-related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants