Skip to content

Merge pull request #1095 from tradingstrategy-ai/temp-fix-inf-value #3575

Merge pull request #1095 from tradingstrategy-ai/temp-fix-inf-value

Merge pull request #1095 from tradingstrategy-ai/temp-fix-inf-value #3575

Workflow file for this run

name: Slow test group
on:
push:
branches: [ master ]
tags: [ v* ]
pull_request:
branches: [ master ]
jobs:
slow-test-suite:
timeout-minutes: 40
runs-on:
group: Beefy runners
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
# pick a nightly release from: https://github.com/foundry-rs/foundry/releases
version: 'nightly-de33b6af53005037b463318d2628b5cfcaf39916'
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# We don't install -E qstrader and run legacy tests on CI as they
# download too much data
run: |
poetry install --all-extras
# pnpm needed to compile Enzyme
# We need version 7 to be exact.
- name: Install pnpm
run: |
curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION=7.27.1 sh -
PNPM_HOME="/home/runner/.local/share/pnpm"
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
echo $PNPM_HOME >> $GITHUB_PATH
# Prepare .sol files for deploy_contract_with_forge() tests.
# As .sol building is needed when we test contracts with deploy with Etherscan verification
- name: Prepare .sol source files
run: |
(cd deps/web3-ethereum-defi && make guard in-house)
# Speed up testing by not downloading integration test data from the production server
# https://github.com/actions/cache
# See conftest.persistent_test_client
- name: Cache datasetes
id: cache-datasets-load
uses: actions/cache@v4
with:
path: ~/.cache/trading-strategy-tests
key: cache-datasets
# Run tests parallel by module
- name: Run test scripts
run: |
# Run tests marked with slow_test_group, print durations of slowest 20
poetry run pytest --tb=native -m slow_test_group --durations=20 -n 6 --dist loadscope
env:
TRADING_STRATEGY_API_KEY: ${{ secrets.TRADING_STRATEGY_API_KEY }}
BNB_CHAIN_JSON_RPC: ${{ secrets.BNB_CHAIN_JSON_RPC }}
# https://stackoverflow.com/a/75274358/315168
PYDEVD_DISABLE_FILE_VALIDATION: 1
JSON_RPC_POLYGON: ${{ secrets.JSON_RPC_POLYGON }}
JSON_RPC_POLYGON_ARCHIVE: ${{ secrets.JSON_RPC_POLYGON_ARCHIVE }}
- name: Save datasets
id: cache-datasets-save
uses: actions/cache/save@v4
with:
path: ~/.cache/trading-strategy-tests
key: cache-datasets