Skip to content

Commit f3271b5

Browse files
committed
Refactor: E2E tests to reflect new services and compute agent
1 parent 9d2270e commit f3271b5

6 files changed

Lines changed: 255 additions & 1279 deletions

File tree

tests/e2e/Dockerfile.test-client

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
11
FROM golang:1.24-alpine AS builder
22

3-
WORKDIR /app
4-
5-
# Copy go mod files
6-
COPY go.mod ./
7-
RUN go mod download
8-
9-
# Copy source code
10-
COPY test-runner.go ./
11-
12-
# Build the test runner
13-
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o test-runner .
14-
15-
# Final stage
16-
FROM alpine:latest
3+
WORKDIR /src
4+
COPY persys-scheduler ./persys-scheduler
5+
RUN cd /src/persys-scheduler && go build -o /out/smoke-client ./cmd/smoke-client
176

18-
RUN apk --no-cache add ca-certificates
19-
20-
WORKDIR /root/
21-
22-
# Copy the binary from builder stage
23-
COPY --from=builder /app/test-runner .
24-
25-
# Make it executable
26-
RUN chmod +x test-runner
7+
FROM alpine:3.21
8+
RUN apk add --no-cache ca-certificates curl jq bash
9+
WORKDIR /app
10+
COPY --from=builder /out/smoke-client ./smoke-client
11+
COPY tests/e2e/test-suite.sh ./test-suite.sh
12+
RUN chmod +x ./smoke-client ./test-suite.sh
2713

28-
# Run the test runner
29-
CMD ["./test-runner"]
14+
CMD ["/bin/sh", "-c", "./test-suite.sh"]

tests/e2e/Makefile

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,26 @@
11
.PHONY: help test test-docker test-script test-go clean
22

3-
# Default target
43
help:
5-
@echo "Persys Cloud E2E Testing"
6-
@echo "========================"
7-
@echo ""
8-
@echo "Available targets:"
9-
@echo " test - Run all E2E tests (default: script-based)"
10-
@echo " test-docker - Run E2E tests using Docker Compose"
11-
@echo " test-script - Run E2E tests using bash script"
12-
@echo " test-go - Run E2E tests using Go test runner"
13-
@echo " clean - Clean up test environment"
14-
@echo ""
4+
@echo "Persys Scheduler E2E"
5+
@echo "===================="
6+
@echo "test - Run docker-compose based scheduler + compute-agent lifecycle suite"
7+
@echo "test-docker - Same as test"
8+
@echo "test-script - Run shell lifecycle suite against locally-running scheduler/agent"
9+
@echo "test-go - Run Go health/metrics probe against locally-running scheduler"
10+
@echo "clean - Tear down compose test stack"
1511

16-
# Default test target
17-
test: test-script
12+
test: test-docker
1813

19-
# Run tests using Docker Compose
2014
test-docker:
21-
@echo "🐳 Running E2E tests with Docker Compose..."
2215
docker compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from test-client
2316
docker compose -f docker-compose.test.yml down
2417

25-
# Run tests using bash script
2618
test-script:
27-
@echo "📜 Running E2E tests with bash script..."
28-
@chmod +x test-suite.sh
19+
chmod +x test-suite.sh
2920
./test-suite.sh
3021

31-
# Run tests using Go test runner
3222
test-go:
33-
@echo "🐹 Running E2E tests with Go test runner..."
34-
@if [ ! -f test-runner ]; then \
35-
echo "Building test runner..."; \
36-
go build -o test-runner test-runner.go; \
37-
fi
38-
./test-runner
23+
go run test-runner.go
3924

40-
# Clean up test environment
4125
clean:
42-
@echo "🧹 Cleaning up test environment..."
4326
docker compose -f docker-compose.test.yml down -v 2>/dev/null || true
44-
rm -rf test-configs
45-
rm -f test-runner
46-
docker ps -a --filter "name=persys-cloud-test" --format "{{.ID}}" | xargs -r docker rm -f
47-
docker images --filter "label=persys-cloud-test" --format "{{.ID}}" | xargs -r docker rmi -f
48-
@echo "✅ Cleanup complete!"

0 commit comments

Comments
 (0)