Repository navigation
230 lines (197 loc) 路 7.46 KB
/
Copy pathe2e_pytest.yml
File metadata and controls
230 lines (197 loc) 路 7.46 KB
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
name: "Catalyst e2e Stack - Pytest with Kurtosis"
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: read
concurrency:
group: catalyst-e2e-pytest-${{ github.run_id }}
cancel-in-progress: false
jobs:
e2e-tests-shasta:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 180
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.ref == 'refs/heads/master')
steps:
- name: Checkout catalyst-e2e repository
uses: actions/checkout@v6
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl jq
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- name: Install Kurtosis CLI
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt-get update
sudo apt-get install -y kurtosis-cli
kurtosis version
- name: Clone simple-taiko-node-nethermind repository
uses: actions/checkout@v6
with:
repository: NethermindEth/simple-taiko-node-nethermind
path: simple-taiko-node-nethermind
ref: main
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Docker Build Catalyst Node
run: |
image_name="nethermind/catalyst-node"
image_tag="${GITHUB_SHA:0:8}"
full_image="${image_name}:${image_tag}"
echo "Building Docker image: ${full_image}"
docker buildx build . \
--platform linux/amd64 \
-f Dockerfile \
-t "${full_image}" \
--load
echo "IMAGE_TAG=${full_image}" >> $GITHUB_ENV
echo "Verifying image exists locally:"
docker images | grep "${image_name}" | grep "${image_tag}" || (echo "Error: Image not found locally" && exit 1)
- name: Replace Catalyst Node Image simple taiko node nethermind
working-directory: simple-taiko-node-nethermind
run: |
CATALYST_IMAGE="nethermind/catalyst-node:latest"
sed -i "s|${CATALYST_IMAGE}|${IMAGE_TAG}|g" .env.example
yq eval '.services.catalyst-node-1.pull_policy = "never"' -i docker-compose.yml
yq eval '.services.catalyst-node-2.pull_policy = "never"' -i docker-compose.yml
- name: Run deployment script
working-directory: simple-taiko-node-nethermind
run: |
cp .env.example .env
sed -i 's/^UNZEN_FORK_TIME=0$/UNZEN_FORK_TIME=4294967295/' .env
chmod +x deploy-taiko-full.sh
./deploy-taiko-full.sh --client alethia-reth --force
env:
SECONDS_PER_SLOT: 12
- name: Wait for L1 services to be ready
run: |
echo "Waiting for L1 services to be ready..."
timeout=300
elapsed=0
while [ $elapsed -lt $timeout ]; do
if curl -s http://localhost:32003 -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":0,"method":"eth_blockNumber","params":[]}' > /dev/null 2>&1; then
echo "L1 Execution Layer is ready"
break
fi
echo "Waiting for L1 services... ($elapsed/$timeout seconds)"
sleep 5
elapsed=$((elapsed + 5))
done
if [ $elapsed -ge $timeout ]; then
echo "Timeout waiting for L1 services"
exit 1
fi
- name: Wait for Beacon Node to be ready
run: |
echo "Waiting for Beacon Node to be ready..."
timeout=300
elapsed=0
while [ $elapsed -lt $timeout ]; do
if curl -s http://localhost:33001/lighthouse/syncing > /dev/null 2>&1; then
echo "Beacon Node is ready"
break
fi
echo "Waiting for Beacon Node... ($elapsed/$timeout seconds)"
sleep 5
elapsed=$((elapsed + 5))
done
if [ $elapsed -ge $timeout ]; then
echo "Timeout waiting for Beacon Node"
exit 1
fi
- name: Wait for L2 node to be ready
run: |
echo "Waiting for L2 node to be ready..."
timeout=300
elapsed=0
while [ $elapsed -lt $timeout ]; do
if curl -s http://localhost:8547 -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":0,"method":"eth_blockNumber","params":[]}' > /dev/null 2>&1; then
echo "L2 node is ready"
break
fi
echo "Waiting for L2 node... ($elapsed/$timeout seconds)"
sleep 5
elapsed=$((elapsed + 5))
done
if [ $elapsed -ge $timeout ]; then
echo "Warning: Timeout waiting for L2 node, but continuing with tests"
fi
- name: Wait for L2 nodes p2p connection
run: |
check_peer() {
local rpc_url=$1
local node_name=$2
timeout=60
elapsed=0
while [ $elapsed -lt $timeout ]; do
peer_count=$(curl -s "$rpc_url" \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":0,"method":"net_peerCount","params":[]}' \
| grep -o '"result":"0x[^"]*"' \
| cut -d'"' -f4)
if [ "$peer_count" != "0x0" ] && [ -n "$peer_count" ]; then
echo "$node_name has connected peer(s): $peer_count"
return 0
fi
echo "Waiting for $node_name peer connection... ($elapsed/$timeout seconds)"
sleep 12
elapsed=$((elapsed + 12))
done
echo "$node_name failed to establish a peer connection within ${timeout}s"
return 1
}
echo "Checking node1..."
check_peer "http://localhost:8547" "L2 node1"
echo "Checking node2..."
check_peer "http://localhost:8647" "L2 node2"
- name: docker ps
working-directory: ./e2e_tests
run: |
docker ps
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
cache: 'pip'
- name: Install Python dependencies
working-directory: ./e2e_tests
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Shasta E2E tests
working-directory: ./e2e_tests
env:
PYTHONUNBUFFERED: 1
run: |
cp .env.example.shasta .env
source .env
pytest -v --capture tee-sys -r a --tb=long 2>&1 | tee pytest-shasta.log; exit ${PIPESTATUS[0]}
rm .env
- name: Upload Shasta pytest log file
if: always()
uses: actions/upload-artifact@v6
with:
name: shasta-pytest-logs
path: |
e2e_tests/pytest-shasta.log
retention-days: 15
if-no-files-found: warn
- name: Cleanup
if: always()
working-directory: simple-taiko-node-nethermind
run: |
./remove-taiko-full.sh --force
- name: Summary
run: |
echo "## Shasta E2E tests completed :green_circle:" >> $GITHUB_STEP_SUMMARY