* Re-solve the dependencies for optimization extras * Remove unused reportlab helpers * Update install from source and troubleshooting docs * Fix typos found by cspell * Prevent po menu from launching when optimization toolkit not installed * Add optimization dependencies to default requirements.txt for the CI * Add optimization toolkit installation to the CI * Fix markdown linting * Update CI test dependency installation for matrix tests * Fix markdown linting * Update source installation docs * Clean up ToC in the main readme * Update the SDK documentation * Fix markdown linting after making readme sections linkable * Fix more markdown linting * Fix more markdown linting * Update secrets detection with exclusion rules * Bump detect-secrets configuration * Tune secret detector * Fix more markdown linting * Add optimization toolkit install to installer GH actions * Add optimization toolkit install to docker build * Fix typos * Add "all" extras setting to install torch and riskfolio * Move forecasting dependencies to pyproject.toml * Update CI build configs * Update documentation to feature the "all" extra * Lint markdown * Update docs to specify requirement of having a C compiler * Added log Id to codesigning steps in inteel Macos workflow * Changed disk for the m1 macos build * Changed disk for the m1 macos build * Changed disk for the intel macos build * taking out sigtool removal line * Remove dev version number from pyproject.toml * removing sigtool from all build steps * changes to m1 build and commenting test_report_economy * more m1 build changes * testing exit on conda setup * some more * changing shell to bash to setup conda * bash on lines * bash on all lines * small bash removals * intel fix and test_crypto int test * upgrading setupminiconda version * adding back in intel conda init and reset * intel removal of init * taking bash back out from m1 * removing old codesign lines * adding codesign specific binaries * ssl fix for all terminal * removing if installer * various ssl fixes across commands * fixing ssl mistake * integration test changes * Linting + remove comment * Update poetry.lock * Update requirements * Update the docs to mention that PO is not working on arm arch * Update deps to pin setuptools * Disable reports on pyinstaller packaged version * Update reports * small grammar change for forecast report message * Pin grpcio following introduced regression in 1.51.0 * Update docs to reflect changes in how optimization is installed Co-authored-by: Luqman Bello <lb@Luqmans-MacBook-Pro.local> Co-authored-by: James Simmons <simmonsj330@gmail.com> Co-authored-by: James Simmons <53658028+simmonsj330@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com> Co-authored-by: Chavithra <chavithra@gmail.com>
OpenBB Terminal : Integration Testing
This document is part of the OpenBB Terminal library documentation.
It aims to provide necessary information in order to:
- Build
integration tests - Run
integration tests - Identify errors noted from
integration tests
1.1. Why having integration tests ?
The purpose of integration tests is to provide standard usage examples that can be programmatically run to make sure that a specific functionality of the terminal and the process to utilize that functionality is working properly.
2. How to build integration tests ?
Integration tests themselves are the same as manually running a certain series of steps. As a result, writing tests is easy because the integration test script is just the total list of steps necessary to use a command, command with specific argument, or series of commands.
When you contribute a new feature to the Terminal, it's important that integration tests are added for this particular feature. It is a part of the Checklist for the PR to be approved.
All the integration tests should be insides the scripts folder. The naming convention for scripts
should be test_<menu>_<command>.openbb if you are testing a specific command or test_<menu>.openbb
if you are testing the entire menu. However, it is encouraged to create as specific of integration tests
as possible to identify errors more precisely. Additionally, all tests must end with the exit command.
Examples
Testing a specific command and it's arguments:
script: test_alt_covid.openbb
- - - - - - - - - -
alternative
covid
country Australia
reset
slopes
country US
ov
country Russia
deaths
country United Kingdom
cases
country Canada
rates
exit
Testing an entire menu
test_stocks_options.openbb
- - - - - - - - - -
stocks
options
screen
view
view high_IV
set high_IV
scr
q
unu
calc
load aapl
exp 0
pcr
info
chains
oi
vol
voi
hist 100
grhist 100
plot -x ltd -y iv
parity
binom
load spy
vsurf
exit
3. How to run integration tests ?
Conda Terminal
After navigating to the location of the OpenBBTerminal repo, one can run integration tests in a few different ways using the wildcard expression.
-
Run all integration tests:
python terminal.py scripts/*.openbb -t -
Run some integration tests:
python terminal.py scripts/test_stocks_*.openbb -tThis specific example runs all of the stocks integration tests. One can use this same format for different tests.
-
Run one integration tests:
python terminal.py scripts/test_alt_covid.openbb -t
Installer Terminal
Integration tests can also be used on installers, which is a packaged version of the conda terminal. More information on how to build an installer can be found here.
-
Run all integration tests:
/Full/Path/To/OpenBB\ Terminal/.OpenBB/OpenBBTerminal /Full/Path/To/OpenBBTerminal/OpenBBTerminal/scripts/*.openbb -t -
Run some integration tests:
/Full/Path/To/OpenBB\ Terminal/.OpenBB/OpenBBTerminal /Full/Path/To/OpenBBTerminal/OpenBBTerminal/scripts/test_stocks_*.openbb -t -
Run one integration tests:
/Full/Path/To/OpenBB\ Terminal/.OpenBB/OpenBBTerminal /Full/Path/To/OpenBBTerminal/OpenBBTerminal/scripts/test_alt_covid.openbb -t
The -t argument runs the integration tests in 'test' mode. It is effectively a 'quiet' mode where one
doesn't see the terminal in action. If one were to remove this argument, then the terminal and subsequent
steps will be seen running in real time.
4. Errors
If the -t argument is given, errors that occur during an integration test are shown after all the
selected tests have run. The specific script that has some type of failure occurring, the reason why
it failed, and a summary of all the integration tests that were run is printed. An example is as followed:
/scripts/test_stocks_ba.openbb: Implement enable_gui in a subclass
/scripts/test_stocks_disc.openbb: No tables found
/scripts/test_stocks_dps.openbb: No tables found
/scripts/test_stocks_scr.openbb: 429 Client Error: Too Many Requests for url: https://finviz.com/screener.ashx?v=111&s=ta_toplosers&ft=4&r=101
Summary: Successes: 55 Failures: 4
If the -t argument is not given, then the reason why a specific failure occurs within an integration
test is printed inline while the test is being run.
If there is an error, one can identify the command and or series of steps that causes it fairly easily.