1
- name : Test MetaTrader5 Initialization
1
+ name : Test | MetaTrader5 Integration
2
2
3
3
on :
4
4
push :
@@ -22,25 +22,25 @@ jobs:
22
22
run : |
23
23
# Download MT5 setup
24
24
Invoke-WebRequest -Uri "https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe" -OutFile mt5setup.exe
25
-
25
+
26
26
# Install MT5 silently
27
27
Start-Process -FilePath .\mt5setup.exe -ArgumentList "/auto" -Wait
28
-
28
+
29
29
# Verify installation and set up permissions
30
30
$mtPath = "C:\Program Files\MetaTrader 5\terminal64.exe"
31
31
if (Test-Path $mtPath) {
32
32
Write-Host "MetaTrader 5 installed successfully at: $mtPath"
33
-
33
+
34
34
# Set explicit permissions to ensure we can access files
35
35
icacls "C:\Program Files\MetaTrader 5" /grant:r "Everyone:(OI)(CI)F" /T
36
-
36
+
37
37
# Create base directories needed for MT5
38
38
$baseDir = "$env:APPDATA\MetaQuotes\Terminal"
39
39
if (!(Test-Path $baseDir)) {
40
40
New-Item -Path $baseDir -ItemType Directory -Force
41
41
Write-Host "Created base MT5 directory: $baseDir"
42
42
}
43
-
43
+
44
44
# List installation directory for verification
45
45
Write-Host "MetaTrader 5 installation directory contents:"
46
46
Get-ChildItem "C:\Program Files\MetaTrader 5" | Format-Table Name, LastWriteTime, Length
@@ -59,24 +59,23 @@ jobs:
59
59
# Check for any running MT5 processes before test
60
60
Write-Host "Checking for MetaTrader processes before test:"
61
61
Get-Process | Where-Object { $_.ProcessName -like "*terminal*" } | Format-Table Id, Name, Path
62
-
62
+
63
63
# Run the advanced headless initialization test
64
64
python tests/integration/test_mt5_headless_init.py
65
-
65
+
66
66
# Save exit code but don't fail the build
67
67
$testExitCode = $LASTEXITCODE
68
-
68
+
69
69
# Check for MetaTrader processes after test
70
70
Write-Host "MetaTrader processes after test:"
71
71
Get-Process | Where-Object { $_.ProcessName -like "*terminal*" } | Format-Table Id, Name, Path
72
-
72
+
73
73
# If test failed, continue but log the failure
74
74
if ($testExitCode -ne 0) {
75
75
Write-Host "::warning::MetaTrader5 initialization test failed, but continuing the build"
76
76
} else {
77
77
Write-Host "MetaTrader5 initialization test succeeded!"
78
78
}
79
-
79
+
80
80
# Always exit with success to avoid breaking CI
81
81
exit 0
82
-
0 commit comments