Skip to content

test: skip quoting-engine strategy tests when private module is absent#10

Open
shuofengzhang wants to merge 1 commit intoNunchi-trade:mainfrom
shuofengzhang:fix/skip-quoting-engine-tests-without-private-module
Open

test: skip quoting-engine strategy tests when private module is absent#10
shuofengzhang wants to merge 1 commit intoNunchi-trade:mainfrom
shuofengzhang:fix/skip-quoting-engine-tests-without-private-module

Conversation

@shuofengzhang
Copy link

What changed

  • Added a requires_quoting_engine skip marker in tests/test_engine_strategies.py that checks whether ~/Tee-work-/quoting_engine exists.
  • Applied that marker to strategy test classes that import private quoting-engine-backed strategies (engine_mm, funding_arb, regime_mm, liquidation_mm).
  • Kept registry tests active so OSS environments still validate strategy registration behavior.

Why

  • These tests currently hard-fail in OSS/dev environments without the private quoting_engine checkout, even though the repo documents open-source alternatives.
  • Skipping only the private-dependency strategy tests prevents false-red test runs for external contributors while preserving coverage for testable OSS paths.

Insight / Why this matters

  • Root cause: strategy tests import modules that unconditionally raise ImportError when a local private path (~/Tee-work-/quoting_engine) is absent.
  • Why it is easy to miss: maintainers with private dependencies checked out won't see failures; outside contributors and clean CI/dev setups do.
  • Tradeoff: we trade strict execution of private-dependent tests for portability. This is scoped: only tests requiring the private module are skipped.
  • Impact: contributors can run the public test suite without local private infra, reducing contributor friction and false failure triage.

Practical gain / Why this matters

  • Immediate practical gain: pytest is no longer blocked by private-only imports in standard OSS environments.
  • Beneficiaries: external contributors, new maintainers, and any CI/dev setup without quoting_engine checked out.
  • Likely maintainer acceptability: low-risk, narrowly scoped change that improves test reliability without touching runtime strategy logic.

Testing

  • Reproduction before change:
    • scripts/clone_and_test.sh Nunchi-trade/agent-cli
    • Result: 20 failed, 580 passed (failures due to missing ~/Tee-work-/quoting_engine).
  • Validation after change:
    • source .venv/bin/activate && pytest -q tests/test_engine_strategies.py
    • Result: 3 passed, 20 skipped
    • scripts/clone_and_test.sh Nunchi-trade/agent-cli
    • Result: 580 passed, 20 skipped

Risk analysis

  • Scope limited to test code only; no production behavior changes.
  • Skip condition is explicit and deterministic (filesystem path check).
  • Rollback-safe: removing the decorator block restores previous behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant