Skip to content

Tests catalogue

This page indexes the test files in the tests/ directory by functional domain (current count = find tests -type f -name '*.py' | wc -l, growing as Stories land). Per project policy, every behavior worth shipping has a test, and every test worth keeping is discoverable here.

If a test isn't listed below, it's either (a) a temporary ad-hoc test (in which case it should be moved or deleted) or (b) the index is stale (please open a follow-up Story to fix it — see CVN-N011-EA).

How to run

make test-unit          # Fast unit tests
make test-integration   # Slow integration tests (external deps)
make test-cov           # With coverage
make qa                 # Format + lint + test-unit

Markers : @pytest.mark.unit, @pytest.mark.integration, @pytest.mark.cache, @pytest.mark.etl, @pytest.mark.ml.

Tests by mission area

🎯 ML Boost — Track 5 + 6 + Pipeline contract hardening

File Locks down
tests/integration/test_track5_label_smoothing.py Track 5 variant matrix end-to-end through trainer.train(...) ; type preservation (DataFrame in → DataFrame out) ; calibration contract on (X_val, y_val) ; trainer-side _assert_dmatrix_contract + _assert_calibration_targets_discrete regression bars
tests/integration/test_track6_focal_loss.py Track 6 focal loss 5-variant matrix + temperature scaling + joint Track 5 × Track 6 + XGBWrapper raw_output_logits + FTF factor registration + 6 guardrail rejection cases
tests/unit/training/labels/test_label_pipeline.py Hamilton dataflow nodes (smoothed_y, cv_pred_probs, suspect_mask, final_y, final_weights) + TestSuspectMaskPerClassCap (S08 regression bar : 8 deterministic tests via monkeypatch on cleanlab.filter.find_label_issues)
tests/unit/training/XGBoost/test_focal_loss_formal_verification.py Track 6 SymPy symbolic verification (32 tests : grad/hess equivalence at rel=1e-12 + finite-difference sanity + math invariants)
tests/unit/test_calibration_metrics.py ECE / Brier computation primitives
tests/unit/test_oos_calibrator.py OOS calibration aggregation per fold
tests/unit/test_threshold_calibrator.py ThresholdCalibrator (per-fold theta from f1_binary curve)
tests/unit/test_classification_metrics.py f1_buy, AUC-buy, action_rate primitives
tests/unit/test_calibration_validation.py Pre-calibration data validation
tests/unit/test_threshold_method_routing.py CVN_THRESHOLD_METHOD env routing
tests/unit/test_hpo_objectives_f1_binary.py HPO objective = f1_binary plumbing
tests/unit/test_model_trainers.py Trainer entry points (XGBoost)
tests/unit/test_hyperoptimizer_warm_start.py HPO warm-start

🎯 Filter tuning — win ratio mission

File Locks down
tests/unit/test_filter_chain_executor.py FilterChainExecutor — orchestration + ordering
tests/unit/test_filter_contracts.py Plugin contract (each filter's input/output shape)
tests/unit/test_filter_plugins.py Plugin registry + lookup
tests/unit/test_filter_diagnostics.py Per-filter diagnostic counters (raw vs accepted)
tests/unit/test_filter_gateway_service.py FilterGateway service-side
tests/unit/test_filter_gateway_client.py FilterGateway client-side
tests/unit/test_engine_filter_migration.py Migration from legacy filter pattern
tests/unit/test_cooldown_plugin.py Cooldown filter
tests/unit/test_confirmation_filter.py Confirmation filter (Option D 2-candle pattern)
tests/unit/test_cascade_cooldown.py Cascade cooldown across symbols
tests/unit/test_trade_quality_filter.py Quality filter (last-stage gate)
tests/unit/test_meta_label.py Meta-label filter (López de Prado)
tests/unit/test_meta_label_orchestrator.py Meta-label per-fold orchestration
tests/unit/test_regime_tagger.py Regime tagging (used by regime filter)
tests/unit/test_regime_detector.py Regime detection algorithm
tests/unit/test_cost_model.py Cost filter (slippage + fees)

🎯 Economic value growth mission

File Locks down
tests/unit/test_etv_scoring.py Economic Trade Value scoring per opportunity
tests/unit/audit/test_economic_thresholds.py Economic break-even floors per crypto
tests/unit/test_atr_labeling.py ATR-based labeling (used by PTE strategy)
tests/unit/test_atr_stops.py ATR-based dynamic stops
tests/unit/test_check_exit_continuous.py Continuous-exit logic
tests/unit/test_p040_vol_stable.py P040 — atr_1h stable feature for PTE
tests/unit/test_p038_build_once.py P038 — atr_normalized once-per-fold
tests/unit/test_p033_candle_alignment.py Candle alignment for backtest fairness
tests/unit/test_walk_forward_optimizer.py Walk-forward θ optimizer

Tests by infrastructure area

Backtest engine + WFRB

File Locks down
tests/unit/test_backtest_engine.py cvntrade_backtest_engine LdP + Legacy candle loops
tests/unit/test_backtest_api.py Backtest API surface
tests/unit/test_wf_backtest.py Walk-forward backtest aggregation
tests/unit/test_wfrb_decision_folds.py WFRB decision per fold
tests/unit/test_wfrb_mlflow_query.py WFRB MLflow result query

FTF (finetune) framework

File Locks down
tests/unit/test_finetune_matrix.py Ablation factor matrix definitions
tests/unit/test_finetune_baselines.py Baseline env (ftf_baseline.json fallback chain)
tests/unit/test_finetune_persistence.py finetune_results Postgres persistence
tests/unit/test_finetune_report.py PDF report generator
tests/unit/test_finetune_stats.py BH-corrected p-values + bootstrap CI + Cohen's d
tests/unit/test_finetune_power_mode.py power_mode (HPO trial counts per crypto group)
tests/unit/test_ftf_guardrails.py FTF env guardrails (label_smoothing, cleanlab, focal_loss, PTE envelope, n_features)
tests/unit/test_ftf_config_diff.py Console diff display
tests/unit/test_ftf_config_ui_save_restore.py Console save/restore round-trip
tests/unit/test_dag_finetune_pte_config.py DAG dag_finetune__pte config + run_id parsing
tests/unit/finetune/test_persist_predictions.py Predictions table population
tests/unit/test_preflight_hamilton_exec.py FTF preflight Hamilton executor
tests/unit/test_preflight_framework.py Preflight step framework
tests/unit/test_preflight_fi_reference.py FI reference cache preflight

Pipeline (enrichment, FE, inference, runner)

File Locks down
tests/unit/pipeline/test_inference_api.py InferenceAPI signal generation + thresholding
tests/unit/pipeline/test_pipeline_parity.py Batch ↔ streaming parity (per #614 spec)
tests/unit/pipeline/test_fe_infinity_guard.py FE infinity / NaN guard
tests/unit/pipeline/test_pipeline_runner.py CandlePipeline runner (high-level orchestration)
tests/unit/pipeline/runner/test_assertion.py Runner assertion stack
tests/unit/pipeline/runner/test_builder.py Pipeline builder
tests/unit/pipeline/runner/test_candle_loop.py Candle loop primitives
tests/unit/pipeline/runner/test_steps.py Step composition
tests/unit/test_pipeline_candle_loop.py Legacy candle loop
tests/unit/test_enrichment_service.py EnrichmentAPI service-side
tests/unit/test_enrichment_client.py EnrichmentAPI client-side
tests/unit/test_enrichment_serialization.py Enrichment artefact serialization
tests/unit/test_fe_service.py FeatureEngineeringAPI service
tests/unit/test_fe_client.py FeatureEngineeringAPI client
tests/unit/test_fe_split_embargo.py Split + embargo applied to FE
tests/unit/test_fe_reindex.py FE reindex on cache miss
tests/unit/test_compatible_train_builder.py Compatible train builder (FE artefact pinning)
tests/unit/test_compatibility_gate.py Per-fold compatibility gate

Feature engineering components (legacy module)

File Locks down
tests/dataprep/FE_composants/test_analyseur_stationnarite.py Stationarity analyzer
tests/dataprep/FE_composants/test_debruiteur_donnees.py Wavelet denoiser
tests/dataprep/FE_composants/test_enrichisseur_donnees.py Indicator enricher
tests/dataprep/FE_composants/test_etiquetage_donnees.py Triple-barrier labeling
tests/dataprep/FE_composants/test_filtre_colonnes_inutiles_dict.py Useless-column filter
tests/unit/test_feature_selection.py Feature selection (Variance + IF)
tests/unit/test_feature_selection_framework.py FS framework (CVN-N001-ED, ADR-67)
tests/unit/test_feature_importance_cache.py FI reference cache
tests/unit/test_guardrails_feature_selection_methods.py FS method registry mirror sync

CUSUM + purged k-fold

File Locks down
tests/unit/test_purged_kfold.py PurgedKFold splitter (López de Prado)
tests/unit/test_cusum_filter_fit.py CUSUM σ fit on training cache
tests/unit/test_cusum_manager.py CUSUM manager state
tests/unit/test_cusum_incremental.py Streaming CUSUM update
tests/unit/test_cusum_no_leakage.py CUSUM σ comes from training cache (no leakage)
tests/unit/test_cusum_label_alignment.py CUSUM gating ↔ label alignment
tests/unit/test_cusum_gate_warn.py CUSUM gate warning emission
tests/unit/test_cusum_training_mode_disabled.py CUSUM training mode (rejected variant per Phase 1b)
tests/unit/test_issue_295_cusum_before_split.py CUSUM applied before split (regression bar)
tests/unit/test_issue_234_cusum_blocked.py Issue #234 — CUSUM blocked symbols

Cache + versioning

File Locks down
tests/test_cache_architecture.py 3-layer cache (L1/L2/L3)
tests/test_intelligent_cache.py Adaptive cache decisions
tests/test_coherent_cache_naming.py Cache key naming convention
tests/test_cache_loading_sprint6.py Sprint 6 cache loading
tests/integration/test_cache_hierarchy.py Cache hierarchy fallback chain
tests/unit/test_cache_manager.py CacheManager API
tests/unit/test_cache_manager_version_propagation.py Version propagation across layers
tests/unit/test_cache_manager_version_extract.py Version extract from artefact
tests/unit/test_cache_versioning.py Versioning policy
tests/unit/test_cache_configuration.py Cache config
tests/unit/test_cache_interface_simple.py Simple cache interface
tests/unit/test_fs_cache_drift_invalidation.py FS cache drift invalidation

Audit (CVN-N007 audit framework)

File Locks down
tests/unit/audit/test_artefacts.py Artefact integrity checks
tests/unit/audit/test_baselines.py Baseline comparison
tests/unit/audit/test_cli.py Audit CLI
tests/unit/audit/test_economic_thresholds.py Economic break-even per crypto
tests/unit/audit/test_label_noise.py Label noise detection
tests/unit/audit/test_leakage.py Temporal leakage detection
tests/unit/audit/test_predictions.py Predictions integrity
tests/unit/audit/test_report.py Audit report rendering
tests/unit/audit/test_signal_ceiling.py Signal ceiling diagnostic
tests/unit/audit/test_statistical_floor.py Statistical floor diagnostic

Trading runtime

File Locks down
tests/unit/test_paper_trading_engine.py Paper trading engine
tests/integration/test_live_trading_safety.py Live trading safety guards
tests/unit/test_live_trading_config.py Live config
tests/unit/test_live_feature_engine.py Live FE
tests/unit/test_signal_generator.py Signal generator
tests/unit/test_state_machine.py Position state machine
tests/unit/test_state_manager.py State manager (event-sourced sessions)
tests/unit/test_event_store.py Event store
tests/unit/test_pt_session_isolation.py Paper trading session isolation
tests/unit/test_order_reconciler.py Order reconciler
tests/unit/test_circuit_breaker.py Circuit breaker (kill-switch foundation)
tests/unit/test_risk_manager.py Risk manager
tests/unit/test_promotion_workflow.py Champion/challenger promotion
tests/unit/test_cross_env_promotion.py Cross-env promotion
tests/unit/test_health_check.py Health check
tests/unit/test_market_data_service.py Market data service
tests/unit/test_market_data_client.py Market data client
tests/unit/test_micro_api_base.py Micro-API base class
tests/unit/test_scoring_client.py Scoring client (Inference façade)

MLflow + model registry

File Locks down
tests/unit/test_model_registry_service.py Model Registry service-side
tests/unit/test_model_registry_client.py Model Registry client-side
tests/unit/test_model_monitor.py Model monitoring
tests/unit/test_lstm_predictor.py LSTM predictor (deferred Track 8)

Drift detection + monitoring

File Locks down
tests/unit/test_drift_detector.py Drift detection algorithm
tests/unit/test_evidently_reporter.py Evidently report rendering
tests/unit/test_mae_tracking.py MAE tracking
tests/unit/test_shadow_first_divergence.py Shadow-mode first-divergence detection
tests/unit/test_observability_otel.py OTel emission
tests/unit/test_alerting.py Alert routing
tests/unit/test_structured_logger.py Structured logging contract (ADR-30/32/33)
tests/unit/test_dashboard_utils.py Dashboard helper utilities

Configuration + validators

File Locks down
tests/unit/test_base_config.py Base config hierarchy
tests/unit/test_config_loader.py Config loader
tests/unit/test_data_validators.py Data validators
tests/unit/test_crypto_groups.py Crypto group definitions
tests/unit/test_timeframe_guard.py Timeframe guardrail
tests/unit/test_train_window_effective.py Effective training window calc
tests/unit/test_timeout_per_crypto.py Per-crypto timeout
tests/unit/test_strategy_testing.py Strategy testing framework
tests/unit/test_strategy_grid_search.py Strategy grid search
tests/unit/test_verdict.py Verdict (gate decision)

DAGs + launchers

File Locks down
tests/dags/test_dag_domain_architecture.py DAG domain architecture (dag_{domain}__{action})
tests/dags/test_launcher_dags.py Launcher DAGs (per ADR-19)

Pipelines + scoring (legacy module names)

File Locks down
tests/training/TwoStage/test_hyperoptimizer.py Two-stage HPO
tests/test_hyperopt_restored.py HPO restoration
tests/unit/regime/test_capture_oos_predictions.py Regime OOS predictions capture
tests/unit/test_adaptive_event_engine.py Adaptive event engine
tests/unit/test_pipeline_runner.py Pipeline runner
tests/unit/test_gs_optimizations.py Grid search optimizations
tests/unit/test_gs_artifact_store.py Grid search artefact store v1
tests/unit/test_gs_artifact_store_v2.py Grid search artefact store v2
tests/unit/test_gs_analyze.py Grid search analyze

Feast + feature store

File Locks down
tests/unit/test_feast_inference.py Feast inference path
tests/unit/test_feast_config.py Feast config

Issue-specific regression bars (legacy naming)

These tests carry the issue number in their filename — they are regression bars for specific historical bugs.

File Issue context
tests/unit/test_issue_224_per_crypto_strategies.py Per-crypto strategy isolation
tests/unit/test_issue_227_cost_filter_atr.py Cost filter ATR usage
tests/unit/test_issue_234_cusum_blocked.py CUSUM blocked symbols
tests/unit/test_issue_235_feature_mismatch.py Feature mismatch on restore
tests/unit/test_issue_237_pt_events.py Paper trading event flow
tests/unit/test_issue_254_backtest_execution.py Backtest execution semantics
tests/unit/test_issue_259_pt_universe.py Paper trading universe
tests/unit/test_issue_259_pt_allocation_gap.py Paper trading allocation gap
tests/unit/test_issue_294_hpo_calibration.py HPO calibration ordering
tests/unit/test_issue_295_cusum_before_split.py CUSUM before split

Misc

File Locks down
tests/test_secrets/test_secrets_manager.py Secrets manager
tests/unit/test_openproject_import_gh.py OpenProject ↔ GH issue sync script
tests/unit/test_stores.py Generic store utilities
tests/unit/test_product_models.py Product models

Coverage policy

Per ADR-58, every FTF factor MUST have a guardrail + integration test ; the integration test goes under tests/integration/test_<track>_<factor>.py and locks down the variant matrix end-to-end through trainer.train(...) (see test_track5_label_smoothing.py and test_track6_focal_loss.py for the canonical pattern).

Per the CVN-N011-EA-S02 ADR amendment (in plan), every Story touching a pipeline boundary MUST have an integration test that replays the actual downstream consumer call (not a mock). This is the lesson from incidents §17.1-§17.3.