Skip to content

Commit 6f0be5b

Browse files
authored
Merge pull request #354 from docker/add-testcontainers
Add integration tests using Testcontainers
2 parents ab707a7 + 70ff06b commit 6f0be5b

File tree

9 files changed

+613
-11
lines changed

9 files changed

+613
-11
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Integration Tests
2+
3+
on:
4+
workflow_dispatch: # Manual trigger only
5+
push:
6+
7+
jobs:
8+
integration-test:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
18+
with:
19+
go-version: 1.24.2
20+
cache: true
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
24+
25+
- name: Run integration tests
26+
run: make integration-tests

Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ SOURCE ?=
2727
TAG ?=
2828
LICENSE ?=
2929

30+
# Test configuration
31+
BUILD_DMR ?= 1
32+
3033
# Main targets
31-
.PHONY: build run clean test docker-build docker-build-multiplatform docker-run docker-build-vllm docker-run-vllm docker-run-impl help validate model-distribution-tool
34+
.PHONY: build run clean test integration-tests docker-build docker-build-multiplatform docker-run docker-build-vllm docker-run-vllm docker-run-impl help validate model-distribution-tool
3235
# Default target
3336
.DEFAULT_GOAL := build
3437

@@ -60,6 +63,19 @@ clean:
6063
test:
6164
go test -v ./...
6265

66+
integration-tests:
67+
@echo "Running integration tests..."
68+
@echo "Note: This requires Docker to be running"
69+
@echo "Checking test naming conventions..."
70+
@INVALID_TESTS=$$(grep "^func Test" cmd/cli/commands/integration_test.go | grep -v "^func TestIntegration"); \
71+
if [ -n "$$INVALID_TESTS" ]; then \
72+
echo "Error: Found test functions that don't start with 'TestIntegration':"; \
73+
echo "$$INVALID_TESTS" | sed 's/func \([^(]*\).*/\1/'; \
74+
exit 1; \
75+
fi
76+
@BUILD_DMR=$(BUILD_DMR) go test -v -race -count=1 -tags=integration -run "^TestIntegration" -timeout=5m ./cmd/cli/commands
77+
@echo "Integration tests completed!"
78+
6379
validate:
6480
find . -type f -name "*.sh" | xargs shellcheck
6581

0 commit comments

Comments
 (0)