Skip to content

Testing and CI

Sergey Gerasimov edited this page Oct 22, 2026 · 7 revisions

Testing & CI

DerivLab is verified locally and on GitHub Actions.


Test suite

pytest -q
ruff check .

The suite contains 247 tests and passes on:

  • Python 3.12 (local development)
  • Python 3.10 (CI and Dev Container)

All tests are offline. tests/conftest.py forces the local LLM provider so a developer's .env key never triggers paid API calls during tests.

Coverage groups

Area What is covered
Option math Black-Scholes, Greeks, intrinsic value
Strategies Plans, legs, credit/debit signs, condor wings
Backtest engine NAV, drawdown, metrics, fees, assignment, deterministic runs
Game Scenario slicing, alerts, actions, completion, scoring, errors
AI agents Policies, regime changes, JSON parsing, HTTP clients, retries, fallbacks, reports, news, bridge, arena
UI Streamlit AppTest across all six screens, AI Arena run, game flow, low-capital warnings
Repository Compose restart policy, Dockerfile, Dev Container, seed, screenshots, demo media, secrets hygiene

GitHub Actions

CI

.github/workflows/ci.yml

  • Python 3.10 · lint + tests — installs pinned dependencies, runs Ruff and the full pytest suite.
  • Docker image and health — builds the image, starts the container, polls /_stcore/health, and reports the restart policy.

CodeQL

.github/workflows/codeql.yml

  • Python analysis with build-mode: none.
  • Runs on push, pull request, a weekly schedule, and manual dispatch.
  • Uploads results to Code Scanning.

Required status checks

main is protected. A pull request must pass:

  • Python 3.10 · lint + tests
  • Docker image and health
  • Analyze Python

Strict mode requires the branch to be up to date. Force pushes and branch deletion are disabled. Conversation resolution is required.

The first CodeQL analysis completed with 0 alerts.


Pull request verification

A documentation and demo-media pull request is used to verify:

  1. Both workflows trigger on pull_request.
  2. All three required checks report success.
  3. The branch protection rule accepts the merge.

Local browser smoke test

The demo was verified with Playwright against the Docker container:

  • AI Arena with live OpenAI critic/news.
  • Leaderboard, three-section report, NewsWire, Model stack.
  • Existing Strategy Deck, Backtest Lab, Hold the Position, Data Vault, Field Guide.
  • No console or page errors.

Clone this wiki locally