-
Notifications
You must be signed in to change notification settings - Fork 818
207 lines (192 loc) · 7.89 KB
/
integration-test.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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Docker Integration Test
on:
push:
branches:
- main
- seiv2
pull_request:
branches:
- main
- seiv2
- evm
defaults:
run:
shell: bash
jobs:
integration-tests:
name: Integration Test (${{ matrix.test.name }})
runs-on: ubuntu-latest
timeout-minutes: 30
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DAPP_TESTS_MNEMONIC: ${{ secrets.DAPP_TESTS_MNEMONIC }}
strategy:
# other jobs should run even if one integration test fails
fail-fast: false
matrix:
test: [
{
name: "Wasm Module",
scripts: [
"docker exec sei-node-0 integration_test/contracts/deploy_timelocked_token_contract.sh",
"python3 integration_test/scripts/runner.py integration_test/wasm_module/timelocked_token_delegation_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/wasm_module/timelocked_token_admin_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/wasm_module/timelocked_token_withdraw_test.yaml",
"docker exec sei-node-0 integration_test/contracts/deploy_timelocked_token_contract.sh",
"python3 integration_test/scripts/runner.py integration_test/wasm_module/timelocked_token_emergency_withdraw_test.yaml"
]
},
{
name: "Mint & Staking & Bank Module",
scripts: [
"python3 integration_test/scripts/runner.py integration_test/staking_module/staking_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/bank_module/send_funds_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/mint_module/mint_test.yaml"
]
},
{
name: "Gov & Oracle & Authz Module",
scripts: [
"python3 integration_test/scripts/runner.py integration_test/gov_module/gov_proposal_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/gov_module/staking_proposal_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/oracle_module/verify_penalty_counts.yaml",
"python3 integration_test/scripts/runner.py integration_test/oracle_module/set_feeder_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/authz_module/send_authorization_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/authz_module/staking_authorization_test.yaml",
"python3 integration_test/scripts/runner.py integration_test/authz_module/generic_authorization_test.yaml"
]
},
{
name: "Chain Operation Test",
scripts: [
"until [ $(cat build/generated/rpc-launch.complete |wc -l) = 1 ]; do sleep 10; done",
"until [[ $(docker exec sei-rpc-node build/seid status |jq -M -r .SyncInfo.latest_block_height) -gt 10 ]]; do sleep 10; done",
"echo rpc node started",
"python3 integration_test/scripts/runner.py integration_test/chain_operation/snapshot_operation.yaml",
"python3 integration_test/scripts/runner.py integration_test/chain_operation/statesync_operation.yaml"
]
},
{
name: "Distribution Module",
scripts: [
"python3 integration_test/scripts/runner.py integration_test/distribution_module/community_pool.yaml",
"python3 integration_test/scripts/runner.py integration_test/distribution_module/rewards.yaml",
]
},
{
name: "Upgrade Module (Major)",
env: "UPGRADE_VERSION_LIST=v1.0.0,v1.0.1,v1.0.2",
scripts: [
"python3 integration_test/scripts/runner.py integration_test/upgrade_module/major_upgrade_test.yaml"
]
},
{
name: "Upgrade Module (Minor)",
env: "UPGRADE_VERSION_LIST=v1.0.0,v1.0.1,v1.0.2",
scripts: [
"python3 integration_test/scripts/runner.py integration_test/upgrade_module/minor_upgrade_test.yaml"
]
},
{
name: "SeiDB State Store",
scripts: [
"docker exec sei-node-0 integration_test/contracts/deploy_wasm_contracts.sh",
"docker exec sei-node-0 integration_test/contracts/create_tokenfactory_denoms.sh",
"python3 integration_test/scripts/runner.py integration_test/seidb/state_store_test.yaml",
],
},
{
name: "SeiDB State Store",
scripts: [
"docker exec sei-node-0 integration_test/contracts/deploy_wasm_contracts.sh",
"docker exec sei-node-0 integration_test/contracts/create_tokenfactory_denoms.sh",
"python3 integration_test/scripts/runner.py integration_test/seidb/state_store_test.yaml",
]
},
{
name: "EVM Module",
scripts: [
"./integration_test/evm_module/scripts/evm_tests.sh",
]
},
{
name: "EVM Interoperability",
scripts: [
"./integration_test/evm_module/scripts/evm_interoperability_tests.sh"
]
},
{
name: "dApp Tests",
scripts: [
"./integration_test/dapp_tests/dapp_tests.sh seilocal"
]
},
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/setup-node@v2
with:
node-version: '20'
- name: Pyyaml
run: |
pip3 install pyyaml
- name: Install jq
run: sudo apt-get install -y jq
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Start 4 node docker cluster
run: make clean && INVARIANT_CHECK_INTERVAL=10 ${{matrix.test.env}} make docker-cluster-start &
- name: Wait for docker cluster to start
run: |
until [ $(cat build/generated/launch.complete |wc -l) = 4 ]
do
sleep 10
done
sleep 10
- name: Start rpc node
run: make run-rpc-node-skipbuild &
- name: Verify Sei Chain is running
run: python3 integration_test/scripts/runner.py integration_test/startup/startup_test.yaml
- name: ${{ matrix.test.name }}
run: |
scripts=$(echo '${{ toJson(matrix.test.scripts) }}' | jq -r '.[]')
IFS=$'\n' # change the internal field separator to newline
echo $scripts
for script in $scripts
do
bash -c "${script}"
done
unset IFS # revert the internal field separator back to default
integration-test-check:
name: Integration Test Check
runs-on: ubuntu-latest
needs: integration-tests
if: always()
steps:
- name: Get workflow conclusion
id: workflow_conclusion
uses: nick-fields/retry@v2
with:
max_attempts: 2
retry_on: error
timeout_seconds: 30
command: |
jobs=$(curl https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs)
job_statuses=$(echo "$jobs" | jq -r '.jobs[] | .conclusion')
for status in $job_statuses
do
echo "Status: $status"
if [[ "$status" == "failure" ]]; then
echo "Some or all tests have failed!"
exit 1
fi
done
echo "All tests have passed!"