1- name : Test MetaTrader5 Initialization
1+ name : Test | MetaTrader5 Integration
22
33on :
44 push :
@@ -22,25 +22,25 @@ jobs:
2222 run : |
2323 # Download MT5 setup
2424 Invoke-WebRequest -Uri "https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe" -OutFile mt5setup.exe
25-
25+
2626 # Install MT5 silently
2727 Start-Process -FilePath .\mt5setup.exe -ArgumentList "/auto" -Wait
28-
28+
2929 # Verify installation and set up permissions
3030 $mtPath = "C:\Program Files\MetaTrader 5\terminal64.exe"
3131 if (Test-Path $mtPath) {
3232 Write-Host "MetaTrader 5 installed successfully at: $mtPath"
33-
33+
3434 # Set explicit permissions to ensure we can access files
3535 icacls "C:\Program Files\MetaTrader 5" /grant:r "Everyone:(OI)(CI)F" /T
36-
36+
3737 # Create base directories needed for MT5
3838 $baseDir = "$env:APPDATA\MetaQuotes\Terminal"
3939 if (!(Test-Path $baseDir)) {
4040 New-Item -Path $baseDir -ItemType Directory -Force
4141 Write-Host "Created base MT5 directory: $baseDir"
4242 }
43-
43+
4444 # List installation directory for verification
4545 Write-Host "MetaTrader 5 installation directory contents:"
4646 Get-ChildItem "C:\Program Files\MetaTrader 5" | Format-Table Name, LastWriteTime, Length
@@ -59,24 +59,23 @@ jobs:
5959 # Check for any running MT5 processes before test
6060 Write-Host "Checking for MetaTrader processes before test:"
6161 Get-Process | Where-Object { $_.ProcessName -like "*terminal*" } | Format-Table Id, Name, Path
62-
62+
6363 # Run the advanced headless initialization test
6464 python tests/integration/test_mt5_headless_init.py
65-
65+
6666 # Save exit code but don't fail the build
6767 $testExitCode = $LASTEXITCODE
68-
68+
6969 # Check for MetaTrader processes after test
7070 Write-Host "MetaTrader processes after test:"
7171 Get-Process | Where-Object { $_.ProcessName -like "*terminal*" } | Format-Table Id, Name, Path
72-
72+
7373 # If test failed, continue but log the failure
7474 if ($testExitCode -ne 0) {
7575 Write-Host "::warning::MetaTrader5 initialization test failed, but continuing the build"
7676 } else {
7777 Write-Host "MetaTrader5 initialization test succeeded!"
7878 }
79-
79+
8080 # Always exit with success to avoid breaking CI
8181 exit 0
82-
0 commit comments