Skip to content

Commit 3f6a396

Browse files
moshloopclaude
andcommitted
feat(e2e): implement comprehensive E2E testing framework for Commons-DB
- Create E2E test suite with Ginkgo/Gomega BDD framework - Implement ServiceManager for native service lifecycle management - Implement DockerManager for container orchestration - Add helpers for test data generation and fixtures - Create tests for log backends (OpenSearch, Loki, Kubernetes, CloudWatch, GCP, BigQuery) - Create tests for connections (SFTP, SMB, S3, GCS, Azure, Kubernetes, Git, HTTP) - Create tests for secret management and encryption - Create tests for query grammar parsing and execution - Configure deps.yaml for service dependencies - Setup GitHub Actions CI/CD workflow - Add comprehensive documentation and setup guide Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b2ddd8e commit 3f6a396

14 files changed

Lines changed: 2381 additions & 5 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
paths:
9+
- '**.go'
10+
- 'e2e/**'
11+
- '.github/workflows/e2e.yml'
12+
- 'go.mod'
13+
- 'go.sum'
14+
pull_request:
15+
branches:
16+
- main
17+
- develop
18+
paths:
19+
- '**.go'
20+
- 'e2e/**'
21+
- '.github/workflows/e2e.yml'
22+
- 'go.mod'
23+
- 'go.sum'
24+
25+
env:
26+
GO_VERSION: '1.22'
27+
28+
jobs:
29+
e2e-tests:
30+
name: E2E Tests
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
matrix:
34+
os: [ubuntu-latest, macos-latest]
35+
go-version: ['1.22']
36+
timeout-minutes: 30
37+
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
42+
- name: Set up Go
43+
uses: actions/setup-go@v4
44+
with:
45+
go-version: ${{ matrix.go-version }}
46+
cache: true
47+
cache-dependency-path: go.sum
48+
49+
- name: Set up Docker (Ubuntu)
50+
if: runner.os == 'Linux'
51+
run: |
52+
# Docker is pre-installed on Ubuntu runners
53+
docker --version
54+
55+
- name: Set up Docker (macOS)
56+
if: runner.os == 'macOS'
57+
run: |
58+
# Install Docker on macOS via Docker Desktop
59+
brew install docker docker-compose 2>/dev/null || true
60+
docker --version 2>/dev/null || echo "Docker will be installed via Colima"
61+
62+
- name: Install dependencies
63+
run: |
64+
go mod download
65+
go mod verify
66+
67+
- name: Build e2e tests
68+
run: |
69+
go build -v ./e2e
70+
env:
71+
CGO_ENABLED: 1
72+
73+
- name: Run E2E tests with Ginkgo
74+
run: |
75+
go install github.com/onsi/ginkgo/v2/ginkgo@latest
76+
ginkgo -v ./e2e --timeout=10m --poll-progress-after=1m
77+
env:
78+
CGO_ENABLED: 1
79+
continue-on-error: false
80+
81+
- name: Run unit tests for helpers
82+
run: |
83+
go test -v ./e2e/helpers/... -timeout 5m
84+
continue-on-error: false
85+
86+
- name: Collect test coverage
87+
run: |
88+
go test -v ./e2e -coverprofile=coverage-e2e.out
89+
go tool cover -html=coverage-e2e.out -o coverage-e2e.html
90+
continue-on-error: true
91+
92+
- name: Upload coverage reports
93+
if: always()
94+
uses: actions/upload-artifact@v3
95+
with:
96+
name: e2e-coverage-${{ matrix.os }}
97+
path: coverage-e2e.*
98+
99+
- name: Upload test results
100+
if: always()
101+
uses: actions/upload-artifact@v3
102+
with:
103+
name: e2e-test-results-${{ matrix.os }}
104+
path: |
105+
e2e-test-results.json
106+
e2e-test-results.xml
107+
108+
- name: Lint e2e tests
109+
run: |
110+
go vet ./e2e/...
111+
continue-on-error: false
112+
113+
- name: Check code formatting
114+
run: |
115+
go fmt ./e2e/...
116+
continue-on-error: false
117+
118+
e2e-linux:
119+
name: E2E Tests (Linux - Detailed)
120+
runs-on: ubuntu-latest
121+
timeout-minutes: 30
122+
123+
services:
124+
docker:
125+
image: docker:latest
126+
options: >-
127+
--privileged
128+
--health-cmd="docker ps"
129+
--health-interval=10s
130+
--health-timeout=5s
131+
--health-retries=5
132+
133+
steps:
134+
- name: Checkout code
135+
uses: actions/checkout@v4
136+
137+
- name: Set up Go
138+
uses: actions/setup-go@v4
139+
with:
140+
go-version: '1.22'
141+
cache: true
142+
cache-dependency-path: go.sum
143+
144+
- name: Run E2E tests with verbose output
145+
run: |
146+
go install github.com/onsi/ginkgo/v2/ginkgo@latest
147+
ginkgo -v -r ./e2e --timeout=10m --poll-progress-after=1m
148+
env:
149+
CGO_ENABLED: 1
150+
151+
- name: Generate test report
152+
if: always()
153+
run: |
154+
go install github.com/jstemmer/go-junit-report/v2@latest
155+
go test -v ./e2e 2>&1 | go-junit-report -set-exit-code > e2e-report.xml
156+
continue-on-error: true
157+
158+
- name: Upload test report
159+
if: always()
160+
uses: actions/upload-artifact@v3
161+
with:
162+
name: e2e-junit-report
163+
path: e2e-report.xml
164+
165+
quality-gate:
166+
name: Quality Gate
167+
runs-on: ubuntu-latest
168+
needs: [e2e-tests]
169+
if: always()
170+
171+
steps:
172+
- name: Check test results
173+
run: |
174+
if [ "${{ needs.e2e-tests.result }}" = "failure" ]; then
175+
echo "E2E tests failed"
176+
exit 1
177+
fi
178+
echo "All E2E tests passed"
179+
180+
- name: Status check
181+
run: echo "E2E test suite completed successfully"

0 commit comments

Comments
 (0)