37 lines
1.2 KiB
Bash
37 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "Running DeltaForge MVP tests..."
|
|
python3 -m build >/dev/null 2>&1 || true
|
|
if [ -f dist/*wheel* ]; then
|
|
echo "Wheel present, installing..."
|
|
python3 -m pip install dist/*.whl
|
|
fi
|
|
|
|
echo "Installing package in editable mode..."
|
|
python3 -m pip install -e . >/dev/null 2>&1 || true
|
|
|
|
echo "Running unit tests..."
|
|
python3 -m pip install -q pytest || true
|
|
pytest -q || python3 -m unittest discover -q
|
|
|
|
echo "Running deterministic backtest to verify MVP flow..."
|
|
python3 - <<'PY'
|
|
from deltaforge.dsl import Asset, MarketSignal, StrategyDelta
|
|
from deltaforge.core import Curator
|
|
from deltaforge.backtester import Backtester
|
|
from deltaforge.dsl import PlanDelta
|
|
|
|
asset_a = Asset(id="eq-AAPL", type="equity", symbol="AAPL")
|
|
asset_b = Asset(id="eq-MSFT", type="equity", symbol="MSFT")
|
|
sig = MarketSignal(asset=asset_a, timestamp=0.0, price=150.0)
|
|
curator = Curator([asset_a, asset_b])
|
|
plan = curator.synthesize_plan([sig], [
|
|
StrategyDelta(id="s1", assets=[asset_a], objectives={"maximize": "return"}),
|
|
StrategyDelta(id="s2", assets=[asset_b], objectives={"maximize": "return"}),
|
|
])
|
|
bt = Backtester(initial_cash=1000.0)
|
|
res = bt.apply([sig], plan)
|
|
print(res)
|
|
PY
|