Skip to content

Commit 81adeec

Browse files
wu-shengclaude
andcommitted
feat: migrate to testcontainers-go v0.42.0 and upgrade all major dependencies
- Delete compose_provider.go (601 lines) — custom DockerContainer/DockerProvider re-implementation replaced by native testcontainers-go APIs - Delete compose_listener.go (85 lines) — Docker event listener no longer needed; containers are accessible after stack.Up() via stack.ServiceContainer() - Rewrite compose.go to use compose.NewDockerComposeWith + stack.Up/ServiceContainer - Rewrite cleanup/compose.go to use stack.Down - Upgrade testcontainers-go v0.11.1 → v0.42.0 - Upgrade docker/docker v20.10.7 → v28.5.2 - Upgrade k8s.io/* v0.22.2 → v0.35.3 - Upgrade sigs.k8s.io/kind v0.27.0 → v0.31.0 - Upgrade spf13/cobra v1.8.0 → v1.10.2 - Remove docker-compose v1 binary install from CI (v0.42.0 uses Docker Compose v2 plugin) - Update action.yaml Go version to 1.26 Closes #139 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ef073ad commit 81adeec

10 files changed

Lines changed: 860 additions & 2154 deletions

File tree

.github/workflows/e2e-test.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,6 @@ jobs:
4646
- name: Build e2e
4747
run: make linux
4848

49-
- name: Install docker-compose
50-
shell: bash
51-
run: |
52-
if ! command docker-compose 2>&1 > /dev/null; then
53-
echo "Installing docker-compose"
54-
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
55-
sudo chmod +x /usr/local/bin/docker-compose
56-
fi
57-
5849
- name: Run E2E Test
5950
uses: apache/skywalking-infra-e2e@main
6051
with:

action.yaml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,10 @@ runs:
4747
docker version
4848
docker info
4949
echo "DOCKER_API_VERSION=$(docker version --format '{{.Server.APIVersion}}')" >> "$GITHUB_ENV"
50-
- name: Install docker-compose
51-
shell: bash
52-
if: runner.os != 'Windows'
53-
run: |
54-
if ! command docker-compose 2>&1 > /dev/null; then
55-
echo "Installing docker-compose"
56-
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
57-
sudo chmod +x /usr/local/bin/docker-compose
58-
fi
5950
- name: Set up Go
60-
uses: actions/setup-go@v4
51+
uses: actions/setup-go@v5
6152
with:
62-
go-version: 1.24
53+
go-version: 1.26
6354
cache-dependency-path: ${{ github.action_path }}/go.sum
6455
- shell: bash
6556
run: make -C $GITHUB_ACTION_PATH install DESTDIR=/usr/local/bin

go.mod

Lines changed: 189 additions & 83 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 531 additions & 1138 deletions
Large diffs are not rendered by default.

internal/components/cleanup/compose.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
package cleanup
2020

2121
import (
22+
"context"
2223
"fmt"
2324

25+
"github.com/testcontainers/testcontainers-go/modules/compose"
26+
2427
"github.com/apache/skywalking-infra-e2e/internal/config"
2528
"github.com/apache/skywalking-infra-e2e/internal/logger"
2629
"github.com/apache/skywalking-infra-e2e/internal/util"
27-
28-
"github.com/testcontainers/testcontainers-go"
2930
)
3031

3132
func ComposeCleanUp(conf *config.E2EConfig) error {
@@ -35,12 +36,19 @@ func ComposeCleanUp(conf *config.E2EConfig) error {
3536
if composeFilePath == "" {
3637
return fmt.Errorf("no compose config file was provided")
3738
}
38-
composeFilePaths := []string{composeFilePath}
3939
identifier := util.GetIdentity()
40-
compose := testcontainers.NewLocalDockerCompose(composeFilePaths, identifier)
41-
down := compose.Down()
42-
if down.Error != nil {
43-
return down.Error
40+
41+
stack, err := compose.NewDockerComposeWith(
42+
compose.WithStackFiles(composeFilePath),
43+
compose.StackIdentifier(identifier),
44+
)
45+
if err != nil {
46+
return fmt.Errorf("failed to create compose stack: %w", err)
47+
}
48+
49+
err = stack.Down(context.Background(), compose.RemoveVolumes(true), compose.RemoveOrphans(true))
50+
if err != nil {
51+
return fmt.Errorf("failed to down compose stack: %w", err)
4452
}
4553

4654
return nil

0 commit comments

Comments
 (0)