Documentation Index Fetch the complete documentation index at: https://mintlify.com/cowprotocol/solver-rewards/llms.txt
Use this file to discover all available pages before exploring further.
Test structure
All tests live under the tests/ directory:
tests/
├── __init__.py
├── constants.py # Shared test constants
├── unit/ # Fast, offline unit tests
│ ├── models/
│ │ └── test_overdrafts.py
│ ├── test_configs.py
│ ├── test_models.py
│ ├── test_multisend.py
│ └── util_methods.py
└── e2e/ # End-to-end integration tests
├── test_get_block_number.py
├── test_post_transaction.py
├── test_prices.py
├── test_slack_post.py
└── test_token_details.py
tests/unit/ tests run entirely offline. tests/e2e/ tests call live external services (Ethereum node, price APIs, Slack) and require valid credentials in .env.
Running tests
Unit tests
E2E tests
Full suite
Unit tests are fast and require no network access or running services. This runs: python -m pytest tests/unit
What is covered:
test_configs.py — accounting period configuration logic
test_models.py — core data model behaviour
test_multisend.py — multisend transaction construction
models/test_overdrafts.py — solver overdraft calculations
End-to-end tests exercise live integrations. Ensure .env is populated with valid credentials before running. This runs: python -m pytest tests/e2e
What is covered:
test_get_block_number.py — Ethereum block number retrieval
test_post_transaction.py — Safe transaction posting
test_prices.py — token price lookups
test_slack_post.py — Slack alert integration
test_token_details.py — on-chain token metadata
Run unit and e2e tests together. Requires credentials and (if query tests are needed) a local database. This runs unit then e2e in sequence: To include database query tests, use pytest directly after starting the test database:
Database-backed tests
The README documents a workflow for running tests against a local PostgreSQL instance seeded with fixture data. A Dockerfile.db is provided to spin up the test database.
Build the test database image
docker build -t test_db -f Dockerfile.db .
Start the container
docker run -d --name testDB -p 5432:5432 test_db
The container exposes PostgreSQL on the default port 5432.
Run the full test suite
With the database running, execute all tests:
Stop and remove the container when you are done to avoid port conflicts on future runs: docker stop testDB && docker rm testDB
pytest configuration
The project’s pytest.ini contains a single configuration option:
[pytest]
filterwarnings =
ignore::DeprecationWarning
This silences DeprecationWarning noise from third-party libraries (web3, SQLAlchemy stubs, etc.) so test output stays readable.
Makefile reference
test-unit
test-e2e
test-all
# Runs pytest against tests/unit/
$( ACTIVATE ) ; python -m pytest tests/unit