mirror of
https://github.com/triqbit/mt5-ai-xauusd-trader.git
synced 2026-11-02 06:56:15 +00:00
Institutional-grade algorithmic trading requires predictable interfaces and easy configuration. This PR improves the operator and developer experience by: 1. **Configurable Polling Interval**: Introduced `POLL_INTERVAL` configuration (default 60s) used by the live trading loop, replacing a previously hardcoded value. 2. **Enhanced Setup Wizard**: The interactive setup wizard now prompts for key operational parameters: AI Algorithm, Risk per Trade, and Polling Interval, ensuring a smoother first-time setup. 3. **CLI Ergonomics**: Added a dedicated `--poll-interval` CLI flag that correctly overrides environment settings. 4. **Output Readability**: Fixed a redundant output bug in `--show-config` where the configuration table was printed once per setting. 5. **Security & Dependency Safety**: Updated CI workflows to use `.pip-audit.ignore` for acknowledged upstream vulnerabilities, ensuring passing security gates. 6. **Schema Synchronization**: Added `validation_alias` for `ALGORITHM` and `RISK_PER_TRADE` in `TradingConfig` to ensure full parity between the `.env` file, setup wizard, and system state. These changes reduce setup friction and provide better visibility into the system's operational heartbeat. Verified with: - `python main.py --show-config` - `python main.py --setup` - `pytest tests/test_cli_ux.py tests/test_jules_setup_wizard.py tests/test_failure_propagation.py` Co-authored-by: xnessom <255288032+xnessom@users.noreply.github.com>
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
import subprocess
|
|
import sys
|
|
|
|
|
|
def test_cli_help_resilience():
|
|
"""Verify that --help works even if dependencies are missing (logic check)."""
|
|
result = subprocess.run(
|
|
[sys.executable, "main.py", "--help"], capture_output=True, text=True, timeout=30
|
|
)
|
|
assert result.returncode == 0
|
|
assert "MT5 AI/ML Trading Bot" in result.stdout
|
|
assert "Usage Examples" in result.stdout
|
|
|
|
|
|
def test_cli_version_resilience():
|
|
"""Verify that --version works and reads from source directly."""
|
|
result = subprocess.run(
|
|
[sys.executable, "main.py", "--version"], capture_output=True, text=True, timeout=30
|
|
)
|
|
assert result.returncode == 0
|
|
# Should contain a version number like x.y.z
|
|
assert "main.py" in result.stdout
|
|
|
|
|
|
def test_cli_doctor_resilience():
|
|
"""Verify that --doctor works even in uninitialized environment."""
|
|
result = subprocess.run(
|
|
[sys.executable, "main.py", "--doctor"], capture_output=True, text=True, timeout=30
|
|
)
|
|
# --doctor might exit with 1 if issues are found, but it should reach the doctor logic
|
|
assert "System Doctor" in result.stdout or "MT5 AI/ML Trading Bot Doctor" in result.stdout
|