From 2bf162bbb1c59137bf41dffdf1e0932a8ae0c488 Mon Sep 17 00:00:00 2001 From: nhatthm Date: Thu, 7 Mar 2024 22:19:51 +0100 Subject: [PATCH] Fix broken tests --- .mockery.yaml | 22 ++ Makefile | 14 +- go.mod | 42 ++-- go.sum | 106 +++++----- mock/container.go | 220 +++++++++++++++++--- mock/mock.go | 2 - mock/wait/mock.go | 3 - mock/wait/strategy.go | 15 +- mock/wait/{target.go => strategy_target.go} | 67 ++++-- 9 files changed, 373 insertions(+), 118 deletions(-) create mode 100644 .mockery.yaml rename mock/wait/{target.go => strategy_target.go} (76%) diff --git a/.mockery.yaml b/.mockery.yaml new file mode 100644 index 0000000..824aeba --- /dev/null +++ b/.mockery.yaml @@ -0,0 +1,22 @@ +dry-run: false +with-expecter: false +mockname: "{{.InterfaceName}}" +filename: "{{ .InterfaceName | snakecase }}.go" +dir: "mock" +outpkg: mock +packages: + github.com/testcontainers/testcontainers-go: + config: + interfaces: + Container: + config: + + github.com/testcontainers/testcontainers-go/wait: + config: + dir: "mock/wait" + outpkg: "wait" + interfaces: + Strategy: + config: + StrategyTarget: + config: diff --git a/Makefile b/Makefile index 33f7190..78a7e1e 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ -MODULE_NAME=testcontainers-extra +MODULE_NAME = testcontainers-extra VENDOR_DIR = vendor GOLANGCI_LINT_VERSION ?= v1.55.2 +MOCKERY_VERSION ?= v2.42.0 GO ?= go GOLANGCI_LINT ?= $(shell go env GOPATH)/bin/golangci-lint-$(GOLANGCI_LINT_VERSION) +MOCKERY ?= $(shell go env GOPATH)/bin/mockery-$(MOCKERY_VERSION) .PHONY: $(VENDOR_DIR) lint test test-unit @@ -14,6 +16,11 @@ $(VENDOR_DIR): @$(GO) mod vendor @$(GO) mod tidy +.PHONY: generate +generate: $(MOCKERY) + @echo ">> generate mocks" + @$(MOCKERY) + .PHONY: lint lint: $(GOLANGCI_LINT) $(VENDOR_DIR) @$(GOLANGCI_LINT) run -c .golangci.yaml @@ -38,3 +45,8 @@ $(GOLANGCI_LINT): @echo "$(OK_COLOR)==> Installing golangci-lint $(GOLANGCI_LINT_VERSION)$(NO_COLOR)"; \ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin "$(GOLANGCI_LINT_VERSION)" @mv ./bin/golangci-lint $(GOLANGCI_LINT) + +$(MOCKERY): + @echo "$(OK_COLOR)==> Installing mockery $(MOCKERY_VERSION)$(NO_COLOR)"; \ + GOBIN=/tmp $(GO) install github.com/vektra/mockery/$(shell echo "$(MOCKERY_VERSION)" | cut -d '.' -f 1)@$(MOCKERY_VERSION) + @mv /tmp/mockery $(MOCKERY) diff --git a/go.mod b/go.mod index f9191c2..258d42a 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,12 @@ module go.nhat.io/testcontainers-extra -go 1.20 +go 1.21 + +toolchain go1.21.6 require ( github.com/distribution/reference v0.5.0 - github.com/docker/docker v25.0.3+incompatible + github.com/docker/docker v25.0.4+incompatible github.com/docker/go-connections v0.5.0 github.com/stretchr/testify v1.9.0 github.com/testcontainers/testcontainers-go v0.29.1 @@ -14,9 +16,9 @@ require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.11.4 // indirect + github.com/Microsoft/hcsshim v0.12.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/containerd/containerd v1.7.12 // indirect + github.com/containerd/containerd v1.7.13 // indirect github.com/containerd/log v0.1.0 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -26,11 +28,11 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/klauspost/compress v1.17.4 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect @@ -41,24 +43,24 @@ require ( github.com/opencontainers/image-spec v1.1.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect - github.com/shirou/gopsutil/v3 v3.23.12 // indirect + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect + github.com/shirou/gopsutil/v3 v3.24.2 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/tklauser/go-sysconf v0.3.13 // indirect github.com/tklauser/numcpus v0.7.0 // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect - go.opentelemetry.io/otel v1.22.0 // indirect - go.opentelemetry.io/otel/metric v1.22.0 // indirect - go.opentelemetry.io/otel/trace v1.22.0 // indirect - golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.16.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/tools v0.17.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect - google.golang.org/grpc v1.60.1 // indirect - google.golang.org/protobuf v1.32.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/tools v0.19.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 // indirect + google.golang.org/grpc v1.62.1 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 3714d7a..9916eb2 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,31 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= -github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/Microsoft/hcsshim v0.12.0 h1:rbICA+XZFwrBef2Odk++0LjFvClNCJGRK+fsrP254Ts= +github.com/Microsoft/hcsshim v0.12.0/go.mod h1:RZV12pcHCXQ42XnlQ3pz6FZfmrC1C+R4gaOHhRNML1g= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0= -github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk= +github.com/containerd/containerd v1.7.13 h1:wPYKIeGMN8vaggSKuV1X0wZulpMz4CrgEsZdaCyB6Is= +github.com/containerd/containerd v1.7.13/go.mod h1:zT3up6yTRfEUa6+GsITYIJNgSVL9NQ4x4h1RPzk0Wu4= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ= -github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v25.0.4+incompatible h1:XITZTrq+52tZyZxUOtFIahUf3aH367FLxJzt9vZeAF8= +github.com/docker/docker v25.0.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -40,10 +42,8 @@ github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -51,16 +51,18 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed h1:036IscGBfJsFIgJQzlui7nK1Ncm0tp2ktmPj8xO4N/0= -github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= @@ -82,11 +84,12 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= -github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= -github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= -github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= +github.com/shirou/gopsutil/v3 v3.24.2 h1:kcR0erMbLg5/3LcInpw0X/rrPSqq4CDPyI6A6ZRC18Y= +github.com/shirou/gopsutil/v3 v3.24.2/go.mod h1:tSg/594BcA+8UdQU2XcW803GWYgdtauFFPgJCJKZlVk= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -114,25 +117,29 @@ github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= -github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= +github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= +github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= -golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= @@ -141,11 +148,13 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -156,36 +165,39 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= -google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= -google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU= +google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 h1:IR+hp6ypxjH24bkMfEJ0yHR21+gwPWdV+/IBrPQyn3k= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= diff --git a/mock/container.go b/mock/container.go index bc20836..09eefcc 100644 --- a/mock/container.go +++ b/mock/container.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package mock @@ -28,14 +28,21 @@ type Container struct { func (_m *Container) ContainerIP(_a0 context.Context) (string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ContainerIP") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -49,7 +56,15 @@ func (_m *Container) ContainerIP(_a0 context.Context) (string, error) { func (_m *Container) ContainerIPs(_a0 context.Context) ([]string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ContainerIPs") + } + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) []string); ok { r0 = rf(_a0) } else { @@ -58,7 +73,6 @@ func (_m *Container) ContainerIPs(_a0 context.Context) ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -72,6 +86,10 @@ func (_m *Container) ContainerIPs(_a0 context.Context) ([]string, error) { func (_m *Container) CopyDirToContainer(ctx context.Context, hostDirPath string, containerParentPath string, fileMode int64) error { ret := _m.Called(ctx, hostDirPath, containerParentPath, fileMode) + if len(ret) == 0 { + panic("no return value specified for CopyDirToContainer") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, string, int64) error); ok { r0 = rf(ctx, hostDirPath, containerParentPath, fileMode) @@ -86,7 +104,15 @@ func (_m *Container) CopyDirToContainer(ctx context.Context, hostDirPath string, func (_m *Container) CopyFileFromContainer(ctx context.Context, filePath string) (io.ReadCloser, error) { ret := _m.Called(ctx, filePath) + if len(ret) == 0 { + panic("no return value specified for CopyFileFromContainer") + } + var r0 io.ReadCloser + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (io.ReadCloser, error)); ok { + return rf(ctx, filePath) + } if rf, ok := ret.Get(0).(func(context.Context, string) io.ReadCloser); ok { r0 = rf(ctx, filePath) } else { @@ -95,7 +121,6 @@ func (_m *Container) CopyFileFromContainer(ctx context.Context, filePath string) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(ctx, filePath) } else { @@ -109,6 +134,10 @@ func (_m *Container) CopyFileFromContainer(ctx context.Context, filePath string) func (_m *Container) CopyFileToContainer(ctx context.Context, hostFilePath string, containerFilePath string, fileMode int64) error { ret := _m.Called(ctx, hostFilePath, containerFilePath, fileMode) + if len(ret) == 0 { + panic("no return value specified for CopyFileToContainer") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, string, string, int64) error); ok { r0 = rf(ctx, hostFilePath, containerFilePath, fileMode) @@ -123,6 +152,10 @@ func (_m *Container) CopyFileToContainer(ctx context.Context, hostFilePath strin func (_m *Container) CopyToContainer(ctx context.Context, fileContent []byte, containerFilePath string, fileMode int64) error { ret := _m.Called(ctx, fileContent, containerFilePath, fileMode) + if len(ret) == 0 { + panic("no return value specified for CopyToContainer") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, []byte, string, int64) error); ok { r0 = rf(ctx, fileContent, containerFilePath, fileMode) @@ -137,14 +170,21 @@ func (_m *Container) CopyToContainer(ctx context.Context, fileContent []byte, co func (_m *Container) Endpoint(_a0 context.Context, _a1 string) (string, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Endpoint") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, string) string); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(_a0, _a1) } else { @@ -165,14 +205,22 @@ func (_m *Container) Exec(ctx context.Context, cmd []string, options ...exec.Pro _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Exec") + } + var r0 int + var r1 io.Reader + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, []string, ...exec.ProcessOption) (int, io.Reader, error)); ok { + return rf(ctx, cmd, options...) + } if rf, ok := ret.Get(0).(func(context.Context, []string, ...exec.ProcessOption) int); ok { r0 = rf(ctx, cmd, options...) } else { r0 = ret.Get(0).(int) } - var r1 io.Reader if rf, ok := ret.Get(1).(func(context.Context, []string, ...exec.ProcessOption) io.Reader); ok { r1 = rf(ctx, cmd, options...) } else { @@ -181,7 +229,6 @@ func (_m *Container) Exec(ctx context.Context, cmd []string, options ...exec.Pro } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, []string, ...exec.ProcessOption) error); ok { r2 = rf(ctx, cmd, options...) } else { @@ -200,6 +247,10 @@ func (_m *Container) FollowOutput(_a0 testcontainers.LogConsumer) { func (_m *Container) GetContainerID() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetContainerID") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -210,18 +261,45 @@ func (_m *Container) GetContainerID() string { return r0 } +// GetLogProductionErrorChannel provides a mock function with given fields: +func (_m *Container) GetLogProductionErrorChannel() <-chan error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetLogProductionErrorChannel") + } + + var r0 <-chan error + if rf, ok := ret.Get(0).(func() <-chan error); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(<-chan error) + } + } + + return r0 +} + // Host provides a mock function with given fields: _a0 func (_m *Container) Host(_a0 context.Context) (string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Host") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -235,6 +313,10 @@ func (_m *Container) Host(_a0 context.Context) (string, error) { func (_m *Container) IsRunning() bool { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for IsRunning") + } + var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -249,7 +331,15 @@ func (_m *Container) IsRunning() bool { func (_m *Container) Logs(_a0 context.Context) (io.ReadCloser, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Logs") + } + var r0 io.ReadCloser + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (io.ReadCloser, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) io.ReadCloser); ok { r0 = rf(_a0) } else { @@ -258,7 +348,6 @@ func (_m *Container) Logs(_a0 context.Context) (io.ReadCloser, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -272,14 +361,21 @@ func (_m *Container) Logs(_a0 context.Context) (io.ReadCloser, error) { func (_m *Container) MappedPort(_a0 context.Context, _a1 nat.Port) (nat.Port, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for MappedPort") + } + var r0 nat.Port + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, nat.Port) (nat.Port, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, nat.Port) nat.Port); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(nat.Port) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, nat.Port) error); ok { r1 = rf(_a0, _a1) } else { @@ -293,14 +389,21 @@ func (_m *Container) MappedPort(_a0 context.Context, _a1 nat.Port) (nat.Port, er func (_m *Container) Name(_a0 context.Context) (string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Name") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -314,7 +417,15 @@ func (_m *Container) Name(_a0 context.Context) (string, error) { func (_m *Container) NetworkAliases(_a0 context.Context) (map[string][]string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for NetworkAliases") + } + var r0 map[string][]string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (map[string][]string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) map[string][]string); ok { r0 = rf(_a0) } else { @@ -323,7 +434,6 @@ func (_m *Container) NetworkAliases(_a0 context.Context) (map[string][]string, e } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -337,7 +447,15 @@ func (_m *Container) NetworkAliases(_a0 context.Context) (map[string][]string, e func (_m *Container) Networks(_a0 context.Context) ([]string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Networks") + } + var r0 []string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) ([]string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) []string); ok { r0 = rf(_a0) } else { @@ -346,7 +464,6 @@ func (_m *Container) Networks(_a0 context.Context) ([]string, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -360,14 +477,21 @@ func (_m *Container) Networks(_a0 context.Context) ([]string, error) { func (_m *Container) PortEndpoint(_a0 context.Context, _a1 nat.Port, _a2 string) (string, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for PortEndpoint") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, nat.Port, string) (string, error)); ok { + return rf(_a0, _a1, _a2) + } if rf, ok := ret.Get(0).(func(context.Context, nat.Port, string) string); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, nat.Port, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { @@ -381,7 +505,15 @@ func (_m *Container) PortEndpoint(_a0 context.Context, _a1 nat.Port, _a2 string) func (_m *Container) Ports(_a0 context.Context) (nat.PortMap, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Ports") + } + var r0 nat.PortMap + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (nat.PortMap, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) nat.PortMap); ok { r0 = rf(_a0) } else { @@ -390,7 +522,6 @@ func (_m *Container) Ports(_a0 context.Context) (nat.PortMap, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -404,6 +535,10 @@ func (_m *Container) Ports(_a0 context.Context) (nat.PortMap, error) { func (_m *Container) SessionID() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for SessionID") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -418,6 +553,10 @@ func (_m *Container) SessionID() string { func (_m *Container) Start(_a0 context.Context) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Start") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(_a0) @@ -428,13 +567,24 @@ func (_m *Container) Start(_a0 context.Context) error { return r0 } -// StartLogProducer provides a mock function with given fields: _a0 -func (_m *Container) StartLogProducer(_a0 context.Context) error { - ret := _m.Called(_a0) +// StartLogProducer provides a mock function with given fields: _a0, _a1 +func (_m *Container) StartLogProducer(_a0 context.Context, _a1 ...testcontainers.LogProductionOption) error { + _va := make([]interface{}, len(_a1)) + for _i := range _a1 { + _va[_i] = _a1[_i] + } + var _ca []interface{} + _ca = append(_ca, _a0) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for StartLogProducer") + } var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) + if rf, ok := ret.Get(0).(func(context.Context, ...testcontainers.LogProductionOption) error); ok { + r0 = rf(_a0, _a1...) } else { r0 = ret.Error(0) } @@ -446,7 +596,15 @@ func (_m *Container) StartLogProducer(_a0 context.Context) error { func (_m *Container) State(_a0 context.Context) (*types.ContainerState, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for State") + } + var r0 *types.ContainerState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*types.ContainerState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *types.ContainerState); ok { r0 = rf(_a0) } else { @@ -455,7 +613,6 @@ func (_m *Container) State(_a0 context.Context) (*types.ContainerState, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -469,6 +626,10 @@ func (_m *Container) State(_a0 context.Context) (*types.ContainerState, error) { func (_m *Container) Stop(_a0 context.Context, _a1 *time.Duration) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for Stop") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *time.Duration) error); ok { r0 = rf(_a0, _a1) @@ -483,6 +644,10 @@ func (_m *Container) Stop(_a0 context.Context, _a1 *time.Duration) error { func (_m *Container) StopLogProducer() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for StopLogProducer") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -497,6 +662,10 @@ func (_m *Container) StopLogProducer() error { func (_m *Container) Terminate(_a0 context.Context) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Terminate") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context) error); ok { r0 = rf(_a0) @@ -507,13 +676,12 @@ func (_m *Container) Terminate(_a0 context.Context) error { return r0 } -type mockConstructorTestingTNewContainer interface { +// NewContainer creates a new instance of Container. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewContainer(t interface { mock.TestingT Cleanup(func()) -} - -// NewContainer creates a new instance of Container. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewContainer(t mockConstructorTestingTNewContainer) *Container { +}) *Container { mock := &Container{} mock.Mock.Test(t) diff --git a/mock/mock.go b/mock/mock.go index 928a8df..ee9f30d 100644 --- a/mock/mock.go +++ b/mock/mock.go @@ -6,8 +6,6 @@ import ( "github.com/testcontainers/testcontainers-go" ) -//go:generate bash -c "mockery --name Container --dir=\"$(go env GOMODCACHE)/github.com/testcontainers/testcontainers-go@$(go list -m -f '{{ .Version }}' github.com/testcontainers/testcontainers-go)\" --output . --outpkg mock --filename container.go" - // ContainerMocker is Container mocker. type ContainerMocker func(tb testing.TB) *Container diff --git a/mock/wait/mock.go b/mock/wait/mock.go index f561b41..c9dbc53 100644 --- a/mock/wait/mock.go +++ b/mock/wait/mock.go @@ -6,9 +6,6 @@ import ( "github.com/testcontainers/testcontainers-go/wait" ) -//go:generate bash -c "mockery --name Strategy --dir=\"$(go env GOMODCACHE)/github.com/testcontainers/testcontainers-go@$(go list -m -f '{{ .Version }}' github.com/testcontainers/testcontainers-go)/wait\" --output . --outpkg wait --filename strategy.go" -//go:generate bash -c "mockery --name StrategyTarget --dir=\"$(go env GOMODCACHE)/github.com/testcontainers/testcontainers-go@$(go list -m -f '{{ .Version }}' github.com/testcontainers/testcontainers-go)/wait\" --output . --outpkg wait --filename target.go" - // StrategyMocker is Strategy mocker. type StrategyMocker func(tb testing.TB) *Strategy diff --git a/mock/wait/strategy.go b/mock/wait/strategy.go index a3425a4..d983efb 100644 --- a/mock/wait/strategy.go +++ b/mock/wait/strategy.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package wait @@ -18,6 +18,10 @@ type Strategy struct { func (_m *Strategy) WaitUntilReady(_a0 context.Context, _a1 wait.StrategyTarget) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for WaitUntilReady") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, wait.StrategyTarget) error); ok { r0 = rf(_a0, _a1) @@ -28,13 +32,12 @@ func (_m *Strategy) WaitUntilReady(_a0 context.Context, _a1 wait.StrategyTarget) return r0 } -type mockConstructorTestingTNewStrategy interface { +// NewStrategy creates a new instance of Strategy. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStrategy(t interface { mock.TestingT Cleanup(func()) -} - -// NewStrategy creates a new instance of Strategy. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewStrategy(t mockConstructorTestingTNewStrategy) *Strategy { +}) *Strategy { mock := &Strategy{} mock.Mock.Test(t) diff --git a/mock/wait/target.go b/mock/wait/strategy_target.go similarity index 76% rename from mock/wait/target.go rename to mock/wait/strategy_target.go index eecc18d..fdf69cd 100644 --- a/mock/wait/target.go +++ b/mock/wait/strategy_target.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.42.0. DO NOT EDIT. package wait @@ -31,14 +31,22 @@ func (_m *StrategyTarget) Exec(_a0 context.Context, _a1 []string, _a2 ...exec.Pr _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for Exec") + } + var r0 int + var r1 io.Reader + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, []string, ...exec.ProcessOption) (int, io.Reader, error)); ok { + return rf(_a0, _a1, _a2...) + } if rf, ok := ret.Get(0).(func(context.Context, []string, ...exec.ProcessOption) int); ok { r0 = rf(_a0, _a1, _a2...) } else { r0 = ret.Get(0).(int) } - var r1 io.Reader if rf, ok := ret.Get(1).(func(context.Context, []string, ...exec.ProcessOption) io.Reader); ok { r1 = rf(_a0, _a1, _a2...) } else { @@ -47,7 +55,6 @@ func (_m *StrategyTarget) Exec(_a0 context.Context, _a1 []string, _a2 ...exec.Pr } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, []string, ...exec.ProcessOption) error); ok { r2 = rf(_a0, _a1, _a2...) } else { @@ -61,14 +68,21 @@ func (_m *StrategyTarget) Exec(_a0 context.Context, _a1 []string, _a2 ...exec.Pr func (_m *StrategyTarget) Host(_a0 context.Context) (string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Host") + } + var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (string, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) string); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -82,7 +96,15 @@ func (_m *StrategyTarget) Host(_a0 context.Context) (string, error) { func (_m *StrategyTarget) Logs(_a0 context.Context) (io.ReadCloser, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Logs") + } + var r0 io.ReadCloser + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (io.ReadCloser, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) io.ReadCloser); ok { r0 = rf(_a0) } else { @@ -91,7 +113,6 @@ func (_m *StrategyTarget) Logs(_a0 context.Context) (io.ReadCloser, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -105,14 +126,21 @@ func (_m *StrategyTarget) Logs(_a0 context.Context) (io.ReadCloser, error) { func (_m *StrategyTarget) MappedPort(_a0 context.Context, _a1 nat.Port) (nat.Port, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for MappedPort") + } + var r0 nat.Port + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, nat.Port) (nat.Port, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, nat.Port) nat.Port); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(nat.Port) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, nat.Port) error); ok { r1 = rf(_a0, _a1) } else { @@ -126,7 +154,15 @@ func (_m *StrategyTarget) MappedPort(_a0 context.Context, _a1 nat.Port) (nat.Por func (_m *StrategyTarget) Ports(ctx context.Context) (nat.PortMap, error) { ret := _m.Called(ctx) + if len(ret) == 0 { + panic("no return value specified for Ports") + } + var r0 nat.PortMap + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (nat.PortMap, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) nat.PortMap); ok { r0 = rf(ctx) } else { @@ -135,7 +171,6 @@ func (_m *StrategyTarget) Ports(ctx context.Context) (nat.PortMap, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -149,7 +184,15 @@ func (_m *StrategyTarget) Ports(ctx context.Context) (nat.PortMap, error) { func (_m *StrategyTarget) State(_a0 context.Context) (*types.ContainerState, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for State") + } + var r0 *types.ContainerState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*types.ContainerState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *types.ContainerState); ok { r0 = rf(_a0) } else { @@ -158,7 +201,6 @@ func (_m *StrategyTarget) State(_a0 context.Context) (*types.ContainerState, err } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -168,13 +210,12 @@ func (_m *StrategyTarget) State(_a0 context.Context) (*types.ContainerState, err return r0, r1 } -type mockConstructorTestingTNewStrategyTarget interface { +// NewStrategyTarget creates a new instance of StrategyTarget. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStrategyTarget(t interface { mock.TestingT Cleanup(func()) -} - -// NewStrategyTarget creates a new instance of StrategyTarget. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -func NewStrategyTarget(t mockConstructorTestingTNewStrategyTarget) *StrategyTarget { +}) *StrategyTarget { mock := &StrategyTarget{} mock.Mock.Test(t)