Skip to content

Commit

Permalink
Chore: update test dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
yaling888 committed Aug 7, 2024
1 parent 273934d commit 1032053
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 74 deletions.
12 changes: 6 additions & 6 deletions test/clash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"testing"
"time"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/client"
"github.com/docker/go-connections/nat"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -81,7 +81,7 @@ func init() {
}
defer c.Close()

list, err := c.ImageList(context.Background(), types.ImageListOptions{All: true})
list, err := c.ImageList(context.Background(), image.ListOptions{All: true})
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -109,13 +109,13 @@ func init() {
ImageHysteria2,
}

for _, image := range images {
if imageExist(image) {
for _, imageM := range images {
if imageExist(imageM) {
continue
}

println("pulling image:", image)
imageStream, err := c.ImagePull(context.Background(), image, types.ImagePullOptions{})
println("pulling image:", imageM)
imageStream, err := c.ImagePull(context.Background(), imageM, image.PullOptions{})
if err != nil {
panic(err)
}
Expand Down
9 changes: 4 additions & 5 deletions test/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
)
Expand All @@ -19,16 +18,16 @@ func startContainer(cfg *container.Config, hostCfg *container.HostConfig, name s
hostCfg.NetworkMode = "host"
}

container, err := c.ContainerCreate(context.Background(), cfg, hostCfg, nil, nil, name)
containerM, err := c.ContainerCreate(context.Background(), cfg, hostCfg, nil, nil, name)
if err != nil {
return "", err
}

if err = c.ContainerStart(context.Background(), container.ID, types.ContainerStartOptions{}); err != nil {
if err = c.ContainerStart(context.Background(), containerM.ID, container.StartOptions{}); err != nil {
return "", err
}

return container.ID, nil
return containerM.ID, nil
}

func cleanContainer(id string) error {
Expand All @@ -38,6 +37,6 @@ func cleanContainer(id string) error {
}
defer c.Close()

removeOpts := types.ContainerRemoveOptions{Force: true}
removeOpts := container.RemoveOptions{Force: true}
return c.ContainerRemove(context.Background(), id, removeOpts)
}
55 changes: 34 additions & 21 deletions test/go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
module quirktiva-test

go 1.23rc1
go 1.23.0

require (
github.com/docker/docker v24.0.9+incompatible
github.com/docker/go-connections v0.4.0
github.com/docker/docker v27.1.1+incompatible
github.com/docker/go-connections v0.5.0
github.com/miekg/dns v1.1.61
github.com/stretchr/testify v1.9.0
github.com/yaling888/quirktiva v0.0.0
go.uber.org/automaxprocs v1.5.3
golang.org/x/net v0.27.0
golang.org/x/net v0.28.0
)

require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/apernet/hysteria/core/v2 v2.5.1-0.20240702222448-8d9c7fa04c7e // indirect
github.com/apernet/hysteria/extras/v2 v2.5.1-0.20240702222448-8d9c7fa04c7e // indirect
github.com/apernet/quic-go v0.45.2-0.20240702221538-ed74cfbe8b6e // indirect
github.com/cilium/ebpf v0.15.0 // indirect
github.com/apernet/hysteria/core/v2 v2.5.1-0.20240803201434-c62c8c5513f3 // indirect
github.com/apernet/hysteria/extras/v2 v2.5.1-0.20240803201434-c62c8c5513f3 // indirect
github.com/apernet/quic-go v0.45.3-0.20240803200022-e3824dfb4b89 // indirect
github.com/cilium/ebpf v0.16.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.11.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/expr-lang/expr v1.16.9 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/insomniacslk/dhcp v0.0.0-20240628075535-bf3278ac95c1 // indirect
github.com/insomniacslk/dhcp v0.0.0-20240710054256-ddd8a41251c9 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/onsi/ginkgo/v2 v2.9.5 // indirect
Expand All @@ -42,30 +47,38 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/quic-go v0.45.1 // indirect
github.com/samber/lo v1.44.0 // indirect
github.com/quic-go/quic-go v0.46.0 // indirect
github.com/samber/lo v1.46.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240704154744-aed23dbf5ecf // indirect
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240806173335-3b7e16c5f836 // indirect
github.com/vishvananda/netns v0.0.4 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.starlark.net v0.0.0-20240705175910-70002002b310 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.starlark.net v0.0.0-20240725214946-42030a7cedce // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.22.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 // indirect
golang.zx2c4.com/wireguard/windows v0.5.4-0.20230123132234-dcc0eb72a04b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gvisor.dev/gvisor v0.0.0-20240705072110-c2c33a265311 // indirect
gvisor.dev/gvisor v0.0.0-20240807080502-4f6f8f8e3eda // indirect
)

replace github.com/yaling888/quirktiva => ../
Loading

0 comments on commit 1032053

Please sign in to comment.