mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 21:12:16 +00:00
* import order * pylint * no login, go to prompt * add logout and whoami * clear before prompt * black * these are unecessary * error * improve login prompt message * login does not follow the controller pattern, so will name it differently * nop * move logout and change to results * change return obj * ruff * pyupgrade * remove user from statics * message * fetch configs at start * remove unecessary func * unecessary dataclass * change user vars * change login flow * remote logout should not be used * simplify * fix double exit logout bug * wrong exception * apply keys * change controller * mypy * save if no internet * pylint * logout everywhere * breaking changes: move to local/hub models * unused import * fix logout bug * whoami in guest mode * add todo * small bug guest allowed * limit flair length * fix bug on user pull * logout working * handle no connection * logout user when logout * remove keys push * split logger funcs * commant apply configs for now * account to session * rename user * clear sounds better * breaking changes: splitting guest from logged users * pull imports up * delete session model * move logout func * add ability to save and apply keys from remote * no sensitive keys * add support for feature flags * unecessary print * allow settings from differnt modules * change setff to static * change way to set ff * fix bug in applying configs * simplify obbff application * bug on setting configs * allow text ff * obbff in settings * add upload to cfg_plot 1 * data sources + backend * this solves circular import? * move create_session to model * rever logs changes, not needed for now * sync optionally * outline account controller interface * don't sync when guest * block guest on installer * or not and * start routines * fix bug on ff, settings * is installer * implementing chavi suggestions * fix colors on installer prompt * Logging login (#4046) * basic logging for the login * removing unused import * hacking the logs custom filter to not filter the email * black * cooping with the new changes * removing redundant method * ruff * ruff * mypy * SDK login (#4051) * sdk login * adding to the trail map * minor fix * improve sdk expirience * adapting to new changes * add docstrings * block guest from account * change guest msg * change guest messages * add sync on/off * display onoff * missing paragraph * fix glitch on logout * add sys clear * filtering password * filtering the email from user * avoid writing to multiple log files if a user logs out * fix bug, guest allowed in installer without connection * log user on the sdk * split login from lauch * add clear and change messages on account * docstrings * start pull cmd * change account menu description * Fix login bug and decouple some logic (#4056) * fix bug, guest allowed in installer without connection * split login from lauch * improvements on the sdk login --------- Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt> * sync fix * change account controller description * ruff * add help on account cmds * update clear prompt * fix email not in jwt * remove jwt from requiremnts * pull command output * remove character * pull cmd when no data * add space below whoami * fix log filenotfound exception * changed arg name * delete .hist on logout * add asteriscs to password * pylint * uncomment rich config * show only diffs on pull * black# * warn when no changes# * pull msg was switched * apply diff only * breaking?: strbool change * reduce some code * add timeout to hub requests * black * add remote logout * success msg only if success * remove colors in prompt * update docstrings * keep timeout outside funcs * update clear * clear and patch * delete session * routine upload * move .his file to .openbb folder * change apply configs * refactor logout * remove mixed portfolio changes * fix bug in lock file * fix bug pwidth, pheight are floats * fix sources command & add choices * refactor timezone setting * userdata * fix flair * need to cast paths * cast on diff * fix flair default * save session test * get session * data * test remove * test remove with assert * add bad test cases * add exception cases to unittests * test remove cli hist file * black * test apply configs * test apply with sync flag * test create session, session model * login tests, session model * some tests for the hub_model * test logout user * black * test clear vars, reload * test create session * update user-json to user * update user class * add user tests * tests sdk session * tests for hub_model * start account controller tsts * unused import * tests account controller: clear, pull * tests for session_controller * logout success bugfix * add integration test for account * black * move routine related commands to other PR * test for the user input * completed tests for session controller * convert to hist to str) * fix import errors * ruff * ruff tests * fix qa * add help to settings cmds * ruff * fix pull keys bug * point to dev * account model tests * black * ruff * fix for empty feature settings * ruff * don't display config msg if wrong token * general msgs * remove print * ruff * fix sources not updated real time * missing return doc * add guest if no email * Routine remote storage (#4143) * add upload routine command * remove prints * point to local again * add commands * add delete * add download command and upload 409 * list comprehension * add download & save plus upload fixe * add user uuid folder * add list command * ruff * en.yml detail * provide choices to delete & download * add choices to upload * change menu text * starting adding unit tests * bad english * Update test_print_help.txt * genearl msgs * remove print * add docstrings * add unit tests to account controller * change parser * fix routine upload test * add to be implemented tests hub * add to be implemented tests local * add total pages to title * split list into model and view * add docstring * print msg if character * add local model tests * hub tests routines * fix test * point to dev and glob * fix small bug on upload * missing return * log decorators missing * black * ruff * change prompt display * rewrite test * rewrite expected * rewrite call * try passing git action * change .yml everywhere --------- Co-authored-by: Henrique Joaquim <h.joaquim@campus.fct.unl.pt> Co-authored-by: James Maslek <jmaslek11@gmail.com>
258 lines
8.3 KiB
YAML
Vendored
258 lines
8.3 KiB
YAML
Vendored
name: Tests
|
|
env:
|
|
OPENBB_ENABLE_QUICK_EXIT: true
|
|
OPENBB_LOG_COLLECT: false
|
|
OPENBB_USE_ION: false
|
|
OPENBB_USE_PROMPT_TOOLKIT: false
|
|
OPENBB_FILE_OVERWRITE: true
|
|
PIP_DEFAULT_TIMEOUT: 100
|
|
|
|
on: [workflow_dispatch]
|
|
|
|
jobs:
|
|
linting:
|
|
name: General Linting
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # actions/checkout v3.0.2
|
|
|
|
- name: Setup Python 3.9
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.9"
|
|
architecture: x64
|
|
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}
|
|
restore-keys: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- run: pip install bandit black codespell mypy==0.982 safety pylint==2.15.2 packaging==22 ruff==0.0.243
|
|
- run: pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six
|
|
- run: bandit -x ./tests -r . || true
|
|
- run: black --diff --check .
|
|
- run: codespell --ignore-words-list=commun,statics,ro,zar,zlot,jewl,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,vie,hel,ket,toke,certi,buidl,ot,te --quiet-level=2 --skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,./build/pyinstaller,./website/config.toml
|
|
- run: ruff .
|
|
- run: mypy --ignore-missing-imports openbb_terminal
|
|
- run: safety check
|
|
- run: pylint terminal.py openbb_terminal tests
|
|
test:
|
|
name: Base Tests - Ubuntu-latest - Python 3.9
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Python 3.9
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.9"
|
|
architecture: x64
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.1.13
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-v1-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- name: Install dependencies
|
|
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
run: poetry install --no-interaction -E optimization
|
|
|
|
- name: Run tests
|
|
env:
|
|
MPLBACKEND: Agg
|
|
run: |
|
|
source $VENV
|
|
pytest tests/ --optimization
|
|
|
|
- name: Start Terminal and exit
|
|
run: |
|
|
source $VENV
|
|
yes "" | python terminal.py
|
|
markdown-link-check:
|
|
name: Markdown Linting
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
name: Check out the code
|
|
- name: Lint Code Base
|
|
uses: docker://avtodev/markdown-lint:v1
|
|
with:
|
|
args: "./*.md ./changelogs/*.md ./openbb_terminal/**/*.md ./discordbot/**/*.md"
|
|
tests-python:
|
|
name: Vanilla Python Tests - (${{ matrix.python-version }}, ${{ matrix.os }})
|
|
needs: test
|
|
runs-on: ${{ matrix.os }}
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
python-version: ["3.8", "3.9", "3.10"]
|
|
os: [ubuntu-latest, macos-latest]
|
|
exclude:
|
|
- os: ubuntu-latest
|
|
python-version: "3.9"
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
architecture: x64
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.1.13
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Load cached venv
|
|
id: cached-poetry-dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ runner.os }}-v1-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- name: Install dependencies
|
|
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
run: poetry install --no-interaction -E optimization
|
|
|
|
- name: List installed packages
|
|
shell: bash -l {0}
|
|
run: |
|
|
source $VENV
|
|
pip list
|
|
|
|
- name: Run tests
|
|
env:
|
|
MPLBACKEND: Agg
|
|
run: |
|
|
source $VENV
|
|
pytest tests/ --optimization
|
|
|
|
- name: Start Terminal and exit
|
|
run: |
|
|
source $VENV
|
|
yes "" | python terminal.py
|
|
tests-conda:
|
|
name: Anaconda Python Tests - (${{ matrix.python-version }}, ${{ matrix.os }})
|
|
needs: test
|
|
runs-on: ${{ matrix.os }}-latest
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ["ubuntu", "windows"]
|
|
python-version: ["3.9"]
|
|
dependencies: [""]
|
|
include:
|
|
- os: ubuntu
|
|
python: 3.9
|
|
- os: windows
|
|
python: 3.9
|
|
env:
|
|
OS: ${{ matrix.os }}
|
|
PYTHON: ${{ matrix.python }}
|
|
PYTHONNOUSERSITE: 1
|
|
steps:
|
|
- name: Set git to use LF
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
git config --global core.autocrlf false
|
|
git config --global core.eol lf
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
# Need to fetch more than the last commit so that setuptools-scm can
|
|
# create the correct version string. If the number of commits since
|
|
# the last release is greater than this, the version still be wrong.
|
|
# Increase if necessary.
|
|
fetch-depth: 100
|
|
# The GitHub token is preserved by default but this job doesn't need
|
|
# to be able to push to GitHub.
|
|
persist-credentials: false
|
|
|
|
- name: Setup caching for conda packages
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/conda_pkgs_dir
|
|
key: conda-${{ runner.os }}-v1-${{ matrix.python }}-${{ hashFiles('build/conda/conda-3-9-env-full.yaml') }}
|
|
|
|
- name: Setup Miniconda
|
|
uses: conda-incubator/setup-miniconda@v2
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
miniconda-version: "latest"
|
|
auto-update-conda: true
|
|
channels: conda-forge,defaults
|
|
show-channel-urls: true
|
|
channel-priority: flexible
|
|
environment-file: build/conda/conda-3-9-env.yaml
|
|
activate-environment: testing
|
|
# Needed for caching
|
|
use-only-tar-bz2: true
|
|
|
|
- name: Update Temp permissions on windows
|
|
if: runner.os == 'Windows'
|
|
shell: cmd /C CALL {0}
|
|
run: >-
|
|
c:\windows\system32\icacls C:\Users\runneradmin\AppData\Local\Temp /grant "everyone":F /t
|
|
|
|
- name: Get pip cache dir
|
|
shell: bash -l {0}
|
|
id: pip-cache
|
|
run: |
|
|
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
|
|
|
|
- name: pip cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-v1-3-9-pip-${{ hashFiles('requirements-full.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-v1-pip-
|
|
|
|
- name: Uninstall Brotlipy
|
|
shell: bash -l {0}
|
|
run: |
|
|
conda remove brotlipy -y
|
|
|
|
- name: Install dependencies (Bash)
|
|
shell: bash -l {0}
|
|
run: |
|
|
pip install --requirement requirements-full.txt
|
|
|
|
- name: List installed packages (Bash)
|
|
shell: bash -l {0}
|
|
run: |
|
|
conda list
|
|
pip list
|
|
|
|
- name: Run tests (Bash)
|
|
env:
|
|
MPLBACKEND: Agg
|
|
shell: bash -l {0}
|
|
run: pytest tests/ -m "not linux" --optimization
|
|
|
|
- name: Start Terminal and exit
|
|
shell: bash -l {0}
|
|
run: yes "" | python terminal.py
|