File tree Expand file tree Collapse file tree 2 files changed +9
-22
lines changed Expand file tree Collapse file tree 2 files changed +9
-22
lines changed Original file line number Diff line number Diff line change 1
- name : Test | MetaTrader5 Integration Test
1
+ name : Test | Integration Test
2
2
3
3
on : [push]
4
4
70
70
env :
71
71
MT5_LOGIN : ${{ secrets.MT5_LOGIN }}
72
72
MT5_PASSWORD : ${{ secrets.MT5_PASSWORD }}
73
+ MT5_SERVER : " 'MetaQuotes-Demo'"
74
+ MT5_PATH : " C:\\ Program Files\\ MetaTrader 5\\ terminal64.exe"
73
75
run : |
74
- python -c "import os, MetaTrader5 as mt5
75
- print('Python version:', os.sys.version)
76
- print('MetaTrader5 version:', mt5.__version__)
77
- for i in range(10):
78
- try:
79
- if mt5.initialize(login=int(os.getenv('MT5_LOGIN')),
80
- password=os.getenv('MT5_PASSWORD'),
81
- server='MetaQuotes-Demo',
82
- path='C:\\Program Files\\MetaTrader 5\\terminal64.exe'):
83
- print('MT5 initialized successfully')
84
- print(mt5.terminal_info())
85
- mt5.shutdown()
86
- exit(0)
87
- print(f'Attempt {i+1} failed')
88
- except Exception as e:
89
- print(f'Error: {str(e)}')
90
- import time; time.sleep(10)
91
- print('All attempts failed')
92
- exit(1)"
76
+ python -c tests/integration/test_mt5_connection.py
Original file line number Diff line number Diff line change 5
5
print ('Testing MT5 initialization...' )
6
6
7
7
success = False
8
- for attempt in range (12 ):
9
- if mt5 .initialize ():
8
+ for attempt in range (10 ):
9
+ if mt5 .initialize (login = int (os .getenv ('MT5_LOGIN' )),
10
+ password = os .getenv ('MT5_PASSWORD' ),
11
+ server = os .getenv ('MT5_SERVER' ),
12
+ path = os .getenv ('MT5_PATH' )):
10
13
print ('MT5 initialized successfully' )
11
14
mt5 .shutdown ()
12
15
success = True
You can’t perform that action at this time.
0 commit comments