Skip to main content

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 are fast and require no network access or running services.
make test-unit
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

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.
1

Build the test database image

docker build -t test_db -f Dockerfile.db .
2

Start the container

docker run -d --name testDB -p 5432:5432 test_db
The container exposes PostgreSQL on the default port 5432.
3

Run the full test suite

With the database running, execute all tests:
python -m pytest 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

# Runs pytest against tests/unit/
$(ACTIVATE); python -m pytest tests/unit

Build docs developers (and LLMs) love