Add integration tests for execution persistence, metrics, and opportunity writing
CI / lint-test-build (push) Failing after 1m23s

- Implemented integration tests for the execution writer to ensure trade orders and PnL are persisted correctly.
- Created integration tests for the metrics calculator to summarize execution data accurately.
- Added integration tests for the opportunity writer to verify event persistence.
- Established PostgreSQL schema validation tests to ensure all expected tables, columns, and constraints exist.
- Removed outdated unit tests that relied on DuckDB and replaced them with tests using PgStore.
This commit is contained in:
2026-06-07 14:37:53 +02:00
parent 54feb2ecd4
commit 529ff967cc
44 changed files with 1955 additions and 1386 deletions
+4 -3
View File
@@ -8,7 +8,7 @@ from arbitrade.config.service import (
ConfigPairing,
ConfigSetting,
)
from arbitrade.storage.db import DuckDBStore
from arbitrade.storage.pg_store import PgStore
from arbitrade.storage.repositories import (
ConfigBacktestingDefaultsRepository,
ConfigPairingRepository,
@@ -19,7 +19,7 @@ from arbitrade.storage.repositories import (
@pytest.fixture
def mock_store():
"""Create a mock database store."""
store = Mock(spec=DuckDBStore)
store = Mock(spec=PgStore)
return store
@@ -244,7 +244,8 @@ def test_config_pairing_repository_create_pairing(mock_store):
]
# Create pairing
pairing = ConfigPairing(base_asset="BTC", quote_asset="USD", enabled=True, source="Kraken")
pairing = ConfigPairing(
base_asset="BTC", quote_asset="USD", enabled=True, source="Kraken")
result = repo.create_pairing(pairing)