-
Notifications
You must be signed in to change notification settings - Fork 25
281 lines (245 loc) · 11.8 KB
/
dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: tests_development
on:
# push:
# branches: [ "development" ]
pull_request:
branches: [ "development" ]
workflow_dispatch:
jobs:
run_tests_development:
runs-on: ubuntu-22.04
# container: node:20-bookworm
services:
mysql:
image: mysql:8.0.21
env:
MYSQL_ROOT_PASSWORD: unittest_pwd
MYSQL_HOST: '%'
MYSQL_DATABASE: unittest_db
MYSQL_USER: unittest_root
MYSQL_PASSWORD: unittest_pwd
ports:
- 3306:3306
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-python@v5
with:
python-version: '3.7'
- name: install pip
run: |
sudo apt update
sudo apt install -y python3-pip netcat-traditional socat iputils-ping
- name: install packs
run: |
export PIP_BREAK_SYSTEM_PACKAGES=1
sudo apt update --allow-releaseinfo-change
sudo apt install unzip -y
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
unzip sonar-scanner-cli-4.6.2.2472-linux.zip
sudo apt install default-mysql-client -y
# pip3 install coverage coveralls pytest alembic
pip3 install pytest setuptools
- name: clone repo
uses: actions/checkout@v3
- name: check db
run: |
for i in `seq 1 30`;
do
nc -z 172.17.0.1 3306 && echo Success && exit 0
echo -n .
sleep 1
done
echo Failed waiting for MySQL && exit 1
- name: eth_event_listener layers packages test
run: |
pip3 install -r lambda_layers/eth_event_listener/requirements.txt
- name: install other side packages and layers
run: |
pip3 install -r lambda_layers/web3_and_grpc_libraries/requirements.txt
pip3 install -r lambda_layers/common_python_libraries/requirements.txt
pip3 install -r registry/migration/requirements.txt
- name: install npm packages
run: |
# export PIP_BREAK_SYSTEM_PACKAGES=1
# export CFLAGS="-I${PREFIX}/include/python3.11/cpython"
# for requirement_file in `ls */*/requirement*.txt`;do pip3 install -r $requirement_file ;done
# for requirement_file in `ls */requirement*.txt`;do echo "=============$requirement_file=================="; pip3 install -r $requirement_file ;done
# pip3 install -r reqs.txt
for package_file in `ls */package*.json | cut -d '/' -f1`;do npm install $package_file/;done
- name: create db
run: |
# export PIP_BREAK_SYSTEM_PACKAGES=1
# socat TCP-LISTEN:3306,fork TCP:mysql:3306 &
# mysql -h 172.17.0.1 -u root -punittest_pwd -e "create database registry_unittest_db"
mysql -h 127.0.0.1 -P 3306 -u root -punittest_pwd -e "create database registry_unittest_db"
mysql -h 127.0.0.1 -P 3306 -u root -punittest_pwd -e "create database verification_unittest_db"
mysql -h 127.0.0.1 -P 3306 -u root -punittest_pwd -e "GRANT ALL PRIVILEGES ON *.* TO 'unittest_root'@'%';"
export PYTHONPATH=$PWD
for alembic_file in `ls */alembic*.ini | cut -d '/' -f1`;do cd $alembic_file; echo $alembic_file; alembic upgrade head; cd .. ;done
mysql -h 127.0.0.1 -P 3306 -u unittest_root -punittest_pwd unittest_db < orchestrator/testcases/script.sql
- name: common tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r common/requirements.txt
- name: dapp_user tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r dapp_user/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest dapp_user/testcases/unit_testcases/*.py dapp_user/testcases/functional_testcases/*.py
- name: notification tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r notification/requirements.txt
- name: payments tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r payments/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest payments/testcases/unit_testcases/*.py
- name: utility tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install setuptools==65.5.0
pip3 install wheel==0.38.0
pip3 install -r utility/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest utility/testcases/functional_testcases/*.py
- name: contract_api tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r contract_api/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest contract_api/testcases/unit_testcases/*.py contract_api/testcases/unit_testcases/*/*.py contract_api/testcases/functional_testcases/*.py
- name: event_pubsub tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r lambda_layers/web3_and_grpc_libraries/requirements.txt
pip3 install -r lambda_layers/common_python_libraries/requirements.txt
pip3 install -r event_pubsub/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest event_pubsub/testcases/unit_testcases/*.py
- name: orchestrator tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r orchestrator/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest orchestrator/testcases/integration_testcases/*.py orchestrator/testcases/unit_testcases/*.py
- name: registry tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r lambda_layers/web3_and_grpc_libraries/requirements.txt
pip3 install -r lambda_layers/common_python_libraries/requirements.txt
pip3 install -r registry/migration/requirements.txt
pip3 install -r registry/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest registry/testcases/unit_testcases/*.py registry/testcases/functional_testcases/*.py
- name: signer tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r signer/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest signer/testcases/integration_testcases/*.py
- name: verification tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r verification/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest verification/testcases/unit_testcases/*.py verification/testcases/functional_testcases/*.py
- name: wallets tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r wallets/requirements.txt
PYTHONPATH=$PWD python3 -m coverage run -m pytest wallets/testcases/integration_testcases/*.py wallets/testcases/unit_testcases/*.py
run_tests_development_upg:
# tests for services moved to updated environment (node22, python3.12)
runs-on: ubuntu-24.04
services:
mysql:
image: mysql:8.0.21
env:
MYSQL_ROOT_PASSWORD: unittest_pwd
MYSQL_HOST: '%'
MYSQL_DATABASE: unittest_db
MYSQL_USER: unittest_root
MYSQL_PASSWORD: unittest_pwd
ports:
- 3306:3306
steps:
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: install pip
run: |
sudo apt update
sudo apt install -y python3-pip netcat-traditional socat iputils-ping
- name: install packs
run: |
export PIP_BREAK_SYSTEM_PACKAGES=1
sudo apt update --allow-releaseinfo-change
sudo apt install unzip -y
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip
unzip sonar-scanner-cli-4.6.2.2472-linux.zip
sudo apt install default-mysql-client -y
# pip3 install coverage coveralls pytest alembic
pip3 install pytest setuptools
- name: clone repo
uses: actions/checkout@v3
- name: check db
run: |
for i in `seq 1 30`;
do
nc -z 172.17.0.1 3306 && echo Success && exit 0
echo -n .
sleep 1
done
echo Failed waiting for MySQL && exit 1
- name: eth_event_listener layers packages test
run: |
# pip3 install -r lambda_layers/eth_event_listener/requirements.txt
pip3 install -r service_status/requirements.txt
# - name: install other side packages and layers
# run: |
# pip3 install -r lambda_layers/web3_and_grpc_libraries/requirements.txt
# pip3 install -r lambda_layers/common_python_libraries/requirements.txt
# pip3 install -r registry/migration/requirements.txt
- name: install npm packages
run: |
# export PIP_BREAK_SYSTEM_PACKAGES=1
# export CFLAGS="-I${PREFIX}/include/python3.11/cpython"
# for requirement_file in `ls */*/requirement*.txt`;do pip3 install -r $requirement_file ;done
# for requirement_file in `ls */requirement*.txt`;do echo "=============$requirement_file=================="; pip3 install -r $requirement_file ;done
# pip3 install -r reqs.txt
# for package_file in `ls */package*.json | cut -d '/' -f1`;do npm install $package_file/;done
npm install service_status/
# - name: create db
# run: |
# # export PIP_BREAK_SYSTEM_PACKAGES=1
# # socat TCP-LISTEN:3306,fork TCP:mysql:3306 &
# # mysql -h 172.17.0.1 -u root -punittest_pwd -e "create database registry_unittest_db"
# mysql -h 127.0.0.1 -P 3306 -u root -punittest_pwd -e "create database registry_unittest_db"
# mysql -h 127.0.0.1 -P 3306 -u root -punittest_pwd -e "create database verification_unittest_db"
# mysql -h 127.0.0.1 -P 3306 -u root -punittest_pwd -e "GRANT ALL PRIVILEGES ON *.* TO 'unittest_root'@'%';"
# export PYTHONPATH=$PWD
# # for alembic_file in `ls */alembic*.ini | cut -d '/' -f1`;do cd $alembic_file; echo $alembic_file; alembic upgrade head; cd .. ;done
# mysql -h 127.0.0.1 -P 3306 -u unittest_root -punittest_pwd unittest_db < orchestrator/testcases/script.sql
# - name: common tests
# run: |
# export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
# export AWS_XRAY_SDK_ENABLED=false
# pip3 install -r common/requirements.txt
- name: service_status tests
run: |
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
export AWS_XRAY_SDK_ENABLED=false
pip3 install -r service_status/requirements.txt
pip3 install --upgrade protobuf
PYTHONPATH=$PWD python3 -m coverage run -m pytest service_status/testcases/unit_testcases/*.py service_status/testcases/functional_testcases/*.py