Repository navigation
Testing and CI
Savvas Leousis edited this page Sep 26, 2026
·
2 revisions
Tests are written first, run offline by default, and run on every push and pull request.
flowchart LR
P[push / PR] --> T[test<br/>ruff + pytest -n auto]
P --> U[ui<br/>lint, test, build]
P --> A[audit<br/>pip-audit, npm audit]
P --> I[image + deploy lint]
TAG[tag v*.*.*] --> R[release] --> D[deploy]
M[push to main] --> DOC[docs site + wiki pages]
uv run pytest -n auto # everything, in parallel on every core
uv run pytest tests/unit/test_params_spec.py -k "tunable" # one file, by keyword
uv run ruff check .
uv run ruff format .Console tests, from web/: npm test, npm run lint, npm run build.
| Folder | What |
|---|---|
tests/unit/ |
Fast tests of single pieces |
tests/integration/ |
Pieces together: lake, lab, tick, CLI, API, MCP |
tests/integration/live/ |
Real network calls, gated |
web/src/**/*.spec.ts |
Console unit tests (Vitest) |
- Marked
@pytest.mark.liveand placed undertests/integration/live/. - Skipped unless
STONKS_RUN_LIVE_TESTS=1. - Need real keys:
EODHD_API_KEY; Alpaca tests also needALPACA_API_KEYandALPACA_SECRET_KEY. - The EODHD free tier returns an error for fundamentals; those tests skip, not fail.
STONKS_RUN_LIVE_TESTS=1 uv run pytest -m live- TDD: write a failing test first, then the code. Every new component ships with tests.
- Hermetic: default runs use fake data sources and a fake broker connection; no network.
- Secrets never land in git.
| Workflow | When | Does |
|---|---|---|
ci.yml |
push to main, pull requests |
Python lint, format and tests; console client check, lint, tests and build; pip-audit and npm audit; Docker image build and smoke test; Compose, shellcheck and Terraform checks |
codeql.yml |
push to main, pull requests, weekly |
CodeQL security scan |
release.yml |
tag v*.*.*
|
Checks the tag matches pyproject.toml, builds and pushes the image, makes a GitHub release |
deploy.yml |
after a stable release, or by hand | Deploys the tag to the server over SSH |
docs.yml |
push to main
|
Publishes the API docs site and copies the generated API Reference and MCP Tools pages to this wiki |
Source: sleousis/Stonks. Plans and status: docs/roadmap.md.
Start
Concepts
- Architecture
- Data and Storage
- Strategies
- Book Strategies
- Lab and Validation
- Backtesting
- Accounts and Modes
Using Stonks
- Strategy Studio
- Trading Tick
- Risk and Go-Live
- Operations
- Scheduling and Backups
- Deploy
- API and MCP
- Web Console
Reference