Skip to content

Conformance Tests

Every Meridian plugin must pass the conformance test suite before marketplace submission. The tests verify that your plugin follows the SDK contract correctly.

Running Tests

# With the CLI
meridian test conformance

# Or directly with pytest (Python)
python -m pytest tests/ -v

Tests use FakeSidecar — no running infrastructure needed.

Test Categories

Lifecycle Tests (8 tests)

Test What It Verifies
Register Plugin registers with sidecar on startup
State transitions INITIALIZING to READY to RUNNING to STOPPED
Degraded state Plugin handles on_degrade and on_resume
Health check Plugin responds to health check within 5 seconds
Graceful shutdown SIGTERM triggers on_stop(), deregister, exit 0
State save/load Plugin state survives save and restore round-trip
Sidecar readiness Plugin waits for sidecar before sending traffic
Faulted state Consecutive health check failures trigger fault

Message Tests (6 tests)

Test What It Verifies
Publish envelope All required envelope fields present
Subscribe and receive Matching callback fires within 1 second
Dual timestamps ts_event and ts_init both non-zero, ts_init >= ts_event
ACL enforcement Unauthorized publish rejected
Dedup key Duplicate fills suppressed by sidecar
Schema version Valid semver on all messages

Per-Plugin-Type Tests

DGM (7 tests): Three-stage pipeline, streaming subscribe/unsubscribe, normalized output, feed status reporting.

Signal Engine (6 tests): on_data callback, insight schema validation, order submission rejected, topic restriction to platform.signal.*, warmup replay, warmup completion.

CCM (8 tests): Connect/disconnect, submit/cancel/modify order, fill includes trade_id, fill deduplication, session status, reconnection handling.

OMS (9 tests): Create/update/cancel order, compliance request/result flow, allocation block/confirm/affirm.

EMS (8 tests): Placement create/cancel, response lifecycle, strategy selection, RFQ flow, fill recording, fill aggregation.

BOR (12 tests): Position publish, cash movement, settlement confirmation, reconciliation, journal entry, FX rates, corporate action processing.

Total: 64 Tests

All 64 must pass before your plugin can be submitted to the marketplace. The automated review runs these tests against your submission.

Writing Custom Tests

Beyond conformance, write tests specific to your plugin's business logic:

from meridian.testing import FakeSidecar
from meridian import SignalPlugin

def test_my_signal_logic():
    sidecar = FakeSidecar()
    plugin = SignalPlugin("test", sidecar=sidecar)
    # Inject market data
    await sidecar.inject("platform.data.eod.AAPL", {"price": 150.0})
    # Verify your plugin published a signal
    signals = sidecar.payloads_matching("platform.signal.*.alpha")
    assert len(signals) == 1

Next Steps