Skip to content

Optimize scenario tests: tests/scenarios/vectorized_backtests/ #386

@MDUYN

Description

@MDUYN

Problem

The vectorized backtest scenario tests in tests/scenarios/vectorized_backtests/ are too slow for CI (they cause Ubuntu runners to timeout). They are currently skipped via @unittest.skip.

Required changes

  1. Reduce execution time — These tests run multiple vector backtests with parameter grids and multi-year date ranges. Reduce date ranges, shrink parameter grids, and ensure each test completes in under 30 seconds.

  2. Use only offline test data from tests/resources/test_data/ — All data sources must reference CSV files located in tests/resources/test_data/ (or its subdirectories). Tests should not depend on data files scattered across tests/resources/data/ or tests/resources/market_data_sources_for_testing/. This ensures tests are self-contained, reproducible, and don't break when external data files are reorganized.

Affected files

  • tests/scenarios/vectorized_backtests/test_run_vector_backtest.py
  • tests/scenarios/vectorized_backtests/test_run_vector_backtests.py
  • tests/scenarios/vectorized_backtests/test_use_checkpoints.py
  • tests/scenarios/vectorized_backtests/test_use_backtest_storage_directory.py
  • tests/scenarios/vectorized_backtests/test_with_show_progress.py
  • tests/scenarios/vectorized_backtests/test_with_window_filter_function.py
  • tests/scenarios/vectorized_backtests/test_with_final_filter_function.py
  • tests/scenarios/vectorized_backtests/test_vector_backtest_fixes.py
  • tests/scenarios/vectorized_backtests/test_metadata_preservation.py

Acceptance criteria

  • All tests in this folder run in under 30 seconds each
  • All tests use data exclusively from tests/resources/test_data/
  • Remove the @unittest.skip decorator once optimized
  • Tests pass on both macOS and Ubuntu CI runners

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions