Skip to content

Commit f427bf7

Browse files
committed
ci(e2e): replace service-based with manual docker run for pulsar
1 parent d5586fb commit f427bf7

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

.github/workflows/e2e.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,6 @@ jobs:
2727
pulsar-e2e:
2828
runs-on: ubuntu-latest
2929

30-
services:
31-
pulsar:
32-
image: apachepulsar/pulsar:3.3.0
33-
ports:
34-
- 6650:6650
35-
- 8080:8080
36-
options: >-
37-
--entrypoint /bin/bash
38-
-v ${{ github.workspace }}/scripts/pulsar-e2e-entrypoint.sh:/pulsar-entrypoint.sh
39-
--health-cmd "curl -f http://localhost:8080/admin/v2/clusters"
40-
--health-interval 10s
41-
--health-timeout 5s
42-
--health-retries 30
43-
--health-start-period 90s
44-
/pulsar-entrypoint.sh
45-
4630
steps:
4731
- name: Check out code
4832
uses: actions/checkout@v4
@@ -55,8 +39,38 @@ jobs:
5539
- name: Download dependencies
5640
run: go mod download
5741

42+
- name: Start Pulsar container
43+
run: |
44+
docker run -d --name pulsar-standalone \
45+
-p 6650:6650 \
46+
-p 8080:8080 \
47+
-v ${{ github.workspace }}/scripts/pulsar-e2e-entrypoint.sh:/pulsar-entrypoint.sh \
48+
--entrypoint /bin/bash \
49+
apachepulsar/pulsar:3.3.0 \
50+
/pulsar-entrypoint.sh
51+
52+
- name: Wait for Pulsar to be ready
53+
run: |
54+
echo "Waiting for Pulsar to be ready..."
55+
for i in {1..60}; do
56+
if curl -f http://localhost:8080/admin/v2/clusters > /dev/null 2>&1; then
57+
echo "Pulsar is ready!"
58+
break
59+
fi
60+
echo "Attempt $i/60: Pulsar not ready yet..."
61+
sleep 2
62+
done
63+
5864
- name: Run E2E tests
5965
run: go test -v -tags=e2e -race ./pkg/mcp/e2e/...
6066
env:
6167
PULSAR_ADMIN_URL: http://localhost:8080
6268
PULSAR_SERVICE_URL: pulsar://localhost:6650
69+
70+
- name: Show Pulsar logs on failure
71+
if: failure()
72+
run: docker logs pulsar-standalone
73+
74+
- name: Stop Pulsar container
75+
if: always()
76+
run: docker rm -f pulsar-standalone || true

0 commit comments

Comments
 (0)