-
Notifications
You must be signed in to change notification settings - Fork 50
112 lines (98 loc) · 3.23 KB
/
Copy pathe2e-test.yaml
File metadata and controls
112 lines (98 loc) · 3.23 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
name: E2E Tests
on:
pull_request:
branches: [main]
paths:
- 'states/**'
- 'framework/**'
- 'models/**'
- 'storage/**'
- 'cmd/**'
- 'go.mod'
- 'go.sum'
- 'tests/e2e/**'
- '.github/workflows/e2e-test.yaml'
push:
branches: [main]
workflow_dispatch:
inputs:
milvus_image:
description: 'Milvus Docker image to test against'
required: false
default: 'milvusdb/milvus:v2.6.8'
jobs:
e2e-test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
- name: Build birdwatcher
run: |
CGO_ENABLED=0 go build -o ./bin/birdwatcher ./cmd/birdwatcher/main.go
chmod +x ./bin/birdwatcher
echo "Birdwatcher built successfully"
./bin/birdwatcher version || true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
pip install -r tests/e2e/requirements.txt
- name: Start Milvus with docker compose
run: |
docker compose -f tests/e2e/docker-compose.yaml up -d --wait
env:
MILVUS_IMAGE: ${{ github.event.inputs.milvus_image || 'milvusdb/milvus:v2.6.8' }}
- name: Setup test data
run: |
python tests/e2e/setup_test_data.py
- name: Run E2E tests
id: e2e_tests
run: |
chmod +x tests/e2e/test_commands.sh
chmod +x tests/e2e/commands/*.sh
tests/e2e/test_commands.sh 2>&1 | tee e2e_test_output.log
env:
BW_BINARY: ./bin/birdwatcher
ETCD_ADDR: 127.0.0.1:2379
ROOT_PATH: by-dev
LOG_DIR: ./e2e_logs
- name: Collect logs on failure
if: failure()
run: |
docker compose -f tests/e2e/docker-compose.yaml logs milvus > milvus.log 2>&1 || true
docker compose -f tests/e2e/docker-compose.yaml logs etcd > etcd.log 2>&1 || true
docker compose -f tests/e2e/docker-compose.yaml logs minio > minio.log 2>&1 || true
echo "=== Last 200 lines of Milvus Logs ==="
tail -200 milvus.log || true
- name: Display test summary
if: always()
run: |
echo "=== Test Summary ==="
cat ./e2e_logs/test_summary.log || true
echo ""
echo "=== JSON Report Preview ==="
cat ./e2e_logs/test_report.json | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'Total: {d[\"summary\"][\"total\"]}, Passed: {d[\"summary\"][\"passed\"]}, Failed: {d[\"summary\"][\"failed\"]}, Skipped: {d[\"summary\"][\"skipped\"]}')" || true
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-test-logs
path: |
e2e_test_output.log
e2e_logs/
milvus.log
etcd.log
minio.log
retention-days: 7
- name: Cleanup
if: always()
run: |
docker compose -f tests/e2e/docker-compose.yaml down -v || true