From cdee5d4e697a55c9156b1d91ce02702627d30f46 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Fri, 20 Oct 2023 11:48:55 +0200 Subject: [PATCH] fix mock packages --- go.mod | 31 +- go.sum | 98 +----- .../usage_metrics/server/module_test.go | 2 +- internal/tool/testing/mock_tool/BUILD.bazel | 8 +- internal/tool/testing/mock_tool/api.go | 307 ------------------ internal/tool/testing/mock_tool/doc.go | 4 +- internal/tool/testing/mock_tool/tool.go | 76 +++++ .../testing/mock_usage_metrics/BUILD.bazel | 8 +- .../tool/testing/mock_usage_metrics/doc.go | 4 +- .../tool/testing/mock_usage_metrics/tool.go | 289 +++++++++++++++-- 10 files changed, 351 insertions(+), 476 deletions(-) delete mode 100644 internal/tool/testing/mock_tool/api.go create mode 100644 internal/tool/testing/mock_tool/tool.go diff --git a/go.mod b/go.mod index 234d6789..cf79d447 100644 --- a/go.mod +++ b/go.mod @@ -3,26 +3,18 @@ module gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16 go 1.21 require ( - cloud.google.com/go/profiler v0.3.1 github.com/ash2k/stager v0.3.0 - github.com/bmatcuk/doublestar/v2 v2.0.4 github.com/envoyproxy/protoc-gen-validate v1.0.2 - github.com/fluxcd/notification-controller/api v1.0.0 - github.com/fluxcd/pkg/apis/meta v1.1.2 - github.com/fluxcd/source-controller/api v1.0.1 github.com/getsentry/sentry-go v0.25.0 github.com/go-logr/zapr v1.2.4 github.com/golang-jwt/jwt/v5 v5.0.0 github.com/google/go-cmp v0.6.0 github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 - github.com/hashicorp/go-retryablehttp v0.7.4 github.com/prometheus/client_golang v1.17.0 github.com/redis/rueidis v1.0.19 - github.com/robfig/cron/v3 v3.0.1 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 - gitlab.com/gitlab-org/security-products/analyzers/report/v3 v3.7.1 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 go.opentelemetry.io/otel v1.19.0 @@ -37,8 +29,7 @@ require ( go.uber.org/zap v1.26.0 golang.org/x/net v0.17.0 // indirect golang.org/x/sync v0.4.0 - golang.org/x/time v0.3.0 - google.golang.org/api v0.147.0 + golang.org/x/time v0.3.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a google.golang.org/grpc v1.58.3 google.golang.org/protobuf v1.31.0 @@ -52,15 +43,12 @@ require ( k8s.io/kubectl v0.27.2 k8s.io/utils v0.0.0-20230726121419-3b25d923346b nhooyr.io/websocket v1.8.7 - sigs.k8s.io/cli-utils v0.35.1-0.20230809174950-0b156cb0425f sigs.k8s.io/controller-runtime v0.15.0 sigs.k8s.io/yaml v1.3.0 ) require ( - cloud.google.com/go v0.110.8 // indirect cloud.google.com/go/compute v1.23.0 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -70,11 +58,8 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.10.1 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d // indirect - github.com/fatih/camelcase v1.0.0 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect - github.com/fvbommel/sortorder v1.0.1 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -87,18 +72,12 @@ require ( github.com/google/btree v1.0.1 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect - github.com/google/s2a-go v0.1.7 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.3.1 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect - github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jonboulle/clockwork v0.2.2 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.16.0 // indirect @@ -112,7 +91,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -120,24 +98,17 @@ require ( github.com/prometheus/common v0.44.0 // indirect github.com/prometheus/procfs v0.11.1 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spyzhov/ajson v0.9.0 // indirect github.com/xlab/treeprint v1.1.0 // indirect - gitlab.com/gitlab-org/security-products/analyzers/common/v2 v2.24.0 // indirect - gitlab.com/gitlab-org/security-products/analyzers/ruleset v1.0.0 // indirect - go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.14.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index b8572ddb..7eb8d20d 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.110.8 h1:tyNdfIxjzaWctIiLYOTalaLKZ17SI44SKFW26QbOhME= -cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= +cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= -cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/profiler v0.3.1 h1:b5got9Be9Ia0HVvyt7PavWxXEht15B9lWnigdvHtxOc= -cloud.google.com/go/profiler v0.3.1/go.mod h1:GsG14VnmcMFQ9b+kq71wh3EKMZr3WRMgLzNiFRpW7tE= -cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= -cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -23,8 +16,6 @@ github.com/ash2k/stager v0.3.0/go.mod h1:vOx+EpL5MtBmMBX/mYxin4GgrRjxyaHuGGMVMwm github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bmatcuk/doublestar/v2 v2.0.4 h1:6I6oUiT/sU27eE2OFcWqBhL1SwjyvQuOssxT4a1yidI= -github.com/bmatcuk/doublestar/v2 v2.0.4/go.mod h1:QMmcs3H2AUQICWhfzLXz+IYln8lRQmTZRptLie8RgRw= 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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -36,11 +27,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= @@ -51,32 +39,16 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ= github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d h1:105gxyaGwCFad8crR9dcMQWvV9Hvulu6hwUh4tWPJnM= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/fluxcd/notification-controller/api v1.0.0 h1:WiXS116pwhFp7Qe/Fc1GmKCfLBRnZu+rYCeIn07cO+4= -github.com/fluxcd/notification-controller/api v1.0.0/go.mod h1:uamWZwmhSHE7xdJkgRhH4Eo5/SKKILFI4o+CoQjlczc= -github.com/fluxcd/pkg/apis/meta v1.1.2 h1:Unjo7hxadtB2dvGpeFqZZUdsjpRA08YYSBb7dF2WIAM= -github.com/fluxcd/pkg/apis/meta v1.1.2/go.mod h1:BHQyRHCskGMEDf6kDGbgQ+cyiNpUHbLsCOsaMYM2maI= -github.com/fluxcd/source-controller/api v1.0.1 h1:nycylbNBnQd+EO4UHpqXqAQJ1cGAPxgBbrfERCQ1pp8= -github.com/fluxcd/source-controller/api v1.0.1/go.mod h1:rAY5FRFGZUKpIFNyYANHIgPgJPvbALBHWsq/zHw/cXQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fvbommel/sortorder v1.0.1 h1:dSnXLt4mJYH25uDDGa3biZNQsozaUWDSWeKJ0qqFfzE= -github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI= github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -127,12 +99,9 @@ github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVI github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -144,7 +113,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= @@ -157,10 +125,7 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -168,17 +133,10 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20230207041349-798e818bf904 h1:4/hN5RUoecvl+RmJRE2YxKWtnnQls6rQjjW5oV7qg2U= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= -github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= -github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ= -github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= -github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= -github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -190,19 +148,10 @@ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 h1:HcUWd006luQPljE73d5sk+ github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1/go.mod h1:w9Y7gY31krpLmrVU5ZPG9H7l9fZuRu5/3R3S3FMtVQ4= 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/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= -github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= -github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -213,7 +162,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -251,14 +199,10 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= @@ -281,36 +225,24 @@ github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwa github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/redis/rueidis v1.0.19 h1:s65oWtotzlIFN8eMPhyYwxlwLR1lUdhza2KtWprKYSo= github.com/redis/rueidis v1.0.19/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo= -github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= -github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spyzhov/ajson v0.9.0 h1:tF46gJGOenYVj+k9K1U1XpCxVWhmiyY5PsVCAs1+OJ0= -github.com/spyzhov/ajson v0.9.0/go.mod h1:a6oSw0MMb7Z5aD2tPoPO+jq11ETKgXUr2XktHdT8Wt8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -322,20 +254,11 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -gitlab.com/gitlab-org/security-products/analyzers/common/v2 v2.24.0 h1:e4drZgHymJ2uFu5hgEb42QKkOM2X+Q4AL0yn0FyzSv4= -gitlab.com/gitlab-org/security-products/analyzers/common/v2 v2.24.0/go.mod h1:HoDWi0h6DclI8JHsWgxOc+T128UYWyUyVF/Vw4FgwS8= -gitlab.com/gitlab-org/security-products/analyzers/report/v3 v3.7.1 h1:TxuJhvlHxdyEtO9u3esOCkPp4GBjU6Bu8mWzwx3muSM= -gitlab.com/gitlab-org/security-products/analyzers/report/v3 v3.7.1/go.mod h1:oSoQxWtUwCHwUWVtq8J6Zs1lYDBjQsHNKgInCMEVreE= -gitlab.com/gitlab-org/security-products/analyzers/ruleset v1.0.0 h1:IMkx99kHby0P4ALeVOgCaWEccx/wF/CYvqOAmhG6dJU= -gitlab.com/gitlab-org/security-products/analyzers/ruleset v1.0.0/go.mod h1:z7wAlQqgacceK7owA4BJbVr0SOm5gA+ICeTqCqN5uzA= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0 h1:RsQi0qJ2imFfCvZabqzM9cNXBG8k6gXMv1A0cXRmH6A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.45.0/go.mod h1:vsh3ySueQCiKPxFLvjWC4Z135gIa34TQ/NSqkDTZYUM= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 h1:x8Z78aZx8cOF0+Kkazoc7lwUNMGy0LrzEMxTm4BbTxg= @@ -394,7 +317,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR 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.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= @@ -413,17 +335,13 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200915084602-288bc346aa39/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -452,12 +370,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.3.0 h1:8NFhfS6gzxNqjLIYnZxg319wZ5Qjnx4m/CcX+Klzazc= -gomodules.xyz/jsonpatch/v2 v2.3.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/api v0.147.0 h1:Can3FaQo9LlVqxJCodNmeZW/ib3/qKAY3rFeXiHo5gc= -google.golang.org/api v0.147.0/go.mod h1:pQ/9j83DcmPd/5C9e2nFOdjjNkDZ1G+zkbK2uvdkJMs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= @@ -474,9 +386,7 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1: google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -485,10 +395,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= @@ -496,13 +404,11 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/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/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -537,8 +443,6 @@ k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSn k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -sigs.k8s.io/cli-utils v0.35.1-0.20230809174950-0b156cb0425f h1:OjyIfDocv+aDjbTlPaBdEhTpHfnELCi9d3vqpiL6U6U= -sigs.k8s.io/cli-utils v0.35.1-0.20230809174950-0b156cb0425f/go.mod h1:XKi3uN8GULVAc3FRf213/um4X52KtOS0ZZH/7ahsBDY= sigs.k8s.io/controller-runtime v0.15.0 h1:ML+5Adt3qZnMSYxZ7gAverBLNPSMQEibtzAgp0UPojU= sigs.k8s.io/controller-runtime v0.15.0/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= diff --git a/internal/module/usage_metrics/server/module_test.go b/internal/module/usage_metrics/server/module_test.go index 80896692..d0b78199 100644 --- a/internal/module/usage_metrics/server/module_test.go +++ b/internal/module/usage_metrics/server/module_test.go @@ -16,7 +16,7 @@ import ( "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/httpz" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/matcher" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_modserver" - mock_usage_metrics "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_tool" + "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_usage_metrics" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/testhelpers" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/pkg/kascfg" "go.uber.org/mock/gomock" diff --git a/internal/tool/testing/mock_tool/BUILD.bazel b/internal/tool/testing/mock_tool/BUILD.bazel index 58691524..4d607f3c 100644 --- a/internal/tool/testing/mock_tool/BUILD.bazel +++ b/internal/tool/testing/mock_tool/BUILD.bazel @@ -1,16 +1,16 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( - name = "mock_usage_metrics", + name = "mock_tool", testonly = True, srcs = [ - "api.go", "doc.go", + "tool.go", ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_usage_metrics", + importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_tool", visibility = ["//:__subpackages__"], deps = [ - "//internal/module/usage_metrics", "@org_uber_go_mock//gomock", + "@org_uber_go_zap//:zap", ], ) diff --git a/internal/tool/testing/mock_tool/api.go b/internal/tool/testing/mock_tool/api.go deleted file mode 100644 index 7882ae20..00000000 --- a/internal/tool/testing/mock_tool/api.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics (interfaces: UsageTrackerInterface,Counter,UniqueCounter) -// -// Generated by this command: -// -// mockgen -typed -destination api.go gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics UsageTrackerInterface,Counter,UniqueCounter -// -// Package mock_usage_metrics is a generated GoMock package. -package mock_usage_metrics - -import ( - reflect "reflect" - - usage_metrics "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics" - gomock "go.uber.org/mock/gomock" -) - -// MockUsageTrackerInterface is a mock of UsageTrackerInterface interface. -type MockUsageTrackerInterface struct { - ctrl *gomock.Controller - recorder *MockUsageTrackerInterfaceMockRecorder -} - -// MockUsageTrackerInterfaceMockRecorder is the mock recorder for MockUsageTrackerInterface. -type MockUsageTrackerInterfaceMockRecorder struct { - mock *MockUsageTrackerInterface -} - -// NewMockUsageTrackerInterface creates a new mock instance. -func NewMockUsageTrackerInterface(ctrl *gomock.Controller) *MockUsageTrackerInterface { - mock := &MockUsageTrackerInterface{ctrl: ctrl} - mock.recorder = &MockUsageTrackerInterfaceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockUsageTrackerInterface) EXPECT() *MockUsageTrackerInterfaceMockRecorder { - return m.recorder -} - -// CloneUsageData mocks base method. -func (m *MockUsageTrackerInterface) CloneUsageData() *usage_metrics.UsageData { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CloneUsageData") - ret0, _ := ret[0].(*usage_metrics.UsageData) - return ret0 -} - -// CloneUsageData indicates an expected call of CloneUsageData. -func (mr *MockUsageTrackerInterfaceMockRecorder) CloneUsageData() *UsageTrackerInterfaceCloneUsageDataCall { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloneUsageData", reflect.TypeOf((*MockUsageTrackerInterface)(nil).CloneUsageData)) - return &UsageTrackerInterfaceCloneUsageDataCall{Call: call} -} - -// UsageTrackerInterfaceCloneUsageDataCall wrap *gomock.Call -type UsageTrackerInterfaceCloneUsageDataCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *UsageTrackerInterfaceCloneUsageDataCall) Return(arg0 *usage_metrics.UsageData) *UsageTrackerInterfaceCloneUsageDataCall { - c.Call = c.Call.Return(arg0) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *UsageTrackerInterfaceCloneUsageDataCall) Do(f func() *usage_metrics.UsageData) *UsageTrackerInterfaceCloneUsageDataCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *UsageTrackerInterfaceCloneUsageDataCall) DoAndReturn(f func() *usage_metrics.UsageData) *UsageTrackerInterfaceCloneUsageDataCall { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// RegisterCounter mocks base method. -func (m *MockUsageTrackerInterface) RegisterCounter(arg0 string) usage_metrics.Counter { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegisterCounter", arg0) - ret0, _ := ret[0].(usage_metrics.Counter) - return ret0 -} - -// RegisterCounter indicates an expected call of RegisterCounter. -func (mr *MockUsageTrackerInterfaceMockRecorder) RegisterCounter(arg0 any) *UsageTrackerInterfaceRegisterCounterCall { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterCounter", reflect.TypeOf((*MockUsageTrackerInterface)(nil).RegisterCounter), arg0) - return &UsageTrackerInterfaceRegisterCounterCall{Call: call} -} - -// UsageTrackerInterfaceRegisterCounterCall wrap *gomock.Call -type UsageTrackerInterfaceRegisterCounterCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *UsageTrackerInterfaceRegisterCounterCall) Return(arg0 usage_metrics.Counter) *UsageTrackerInterfaceRegisterCounterCall { - c.Call = c.Call.Return(arg0) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *UsageTrackerInterfaceRegisterCounterCall) Do(f func(string) usage_metrics.Counter) *UsageTrackerInterfaceRegisterCounterCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *UsageTrackerInterfaceRegisterCounterCall) DoAndReturn(f func(string) usage_metrics.Counter) *UsageTrackerInterfaceRegisterCounterCall { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// RegisterUniqueCounter mocks base method. -func (m *MockUsageTrackerInterface) RegisterUniqueCounter(arg0 string) usage_metrics.UniqueCounter { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegisterUniqueCounter", arg0) - ret0, _ := ret[0].(usage_metrics.UniqueCounter) - return ret0 -} - -// RegisterUniqueCounter indicates an expected call of RegisterUniqueCounter. -func (mr *MockUsageTrackerInterfaceMockRecorder) RegisterUniqueCounter(arg0 any) *UsageTrackerInterfaceRegisterUniqueCounterCall { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterUniqueCounter", reflect.TypeOf((*MockUsageTrackerInterface)(nil).RegisterUniqueCounter), arg0) - return &UsageTrackerInterfaceRegisterUniqueCounterCall{Call: call} -} - -// UsageTrackerInterfaceRegisterUniqueCounterCall wrap *gomock.Call -type UsageTrackerInterfaceRegisterUniqueCounterCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *UsageTrackerInterfaceRegisterUniqueCounterCall) Return(arg0 usage_metrics.UniqueCounter) *UsageTrackerInterfaceRegisterUniqueCounterCall { - c.Call = c.Call.Return(arg0) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *UsageTrackerInterfaceRegisterUniqueCounterCall) Do(f func(string) usage_metrics.UniqueCounter) *UsageTrackerInterfaceRegisterUniqueCounterCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *UsageTrackerInterfaceRegisterUniqueCounterCall) DoAndReturn(f func(string) usage_metrics.UniqueCounter) *UsageTrackerInterfaceRegisterUniqueCounterCall { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// Subtract mocks base method. -func (m *MockUsageTrackerInterface) Subtract(arg0 *usage_metrics.UsageData) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Subtract", arg0) -} - -// Subtract indicates an expected call of Subtract. -func (mr *MockUsageTrackerInterfaceMockRecorder) Subtract(arg0 any) *UsageTrackerInterfaceSubtractCall { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subtract", reflect.TypeOf((*MockUsageTrackerInterface)(nil).Subtract), arg0) - return &UsageTrackerInterfaceSubtractCall{Call: call} -} - -// UsageTrackerInterfaceSubtractCall wrap *gomock.Call -type UsageTrackerInterfaceSubtractCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *UsageTrackerInterfaceSubtractCall) Return() *UsageTrackerInterfaceSubtractCall { - c.Call = c.Call.Return() - return c -} - -// Do rewrite *gomock.Call.Do -func (c *UsageTrackerInterfaceSubtractCall) Do(f func(*usage_metrics.UsageData)) *UsageTrackerInterfaceSubtractCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *UsageTrackerInterfaceSubtractCall) DoAndReturn(f func(*usage_metrics.UsageData)) *UsageTrackerInterfaceSubtractCall { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// MockCounter is a mock of Counter interface. -type MockCounter struct { - ctrl *gomock.Controller - recorder *MockCounterMockRecorder -} - -// MockCounterMockRecorder is the mock recorder for MockCounter. -type MockCounterMockRecorder struct { - mock *MockCounter -} - -// NewMockCounter creates a new mock instance. -func NewMockCounter(ctrl *gomock.Controller) *MockCounter { - mock := &MockCounter{ctrl: ctrl} - mock.recorder = &MockCounterMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockCounter) EXPECT() *MockCounterMockRecorder { - return m.recorder -} - -// Inc mocks base method. -func (m *MockCounter) Inc() { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Inc") -} - -// Inc indicates an expected call of Inc. -func (mr *MockCounterMockRecorder) Inc() *CounterIncCall { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Inc", reflect.TypeOf((*MockCounter)(nil).Inc)) - return &CounterIncCall{Call: call} -} - -// CounterIncCall wrap *gomock.Call -type CounterIncCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *CounterIncCall) Return() *CounterIncCall { - c.Call = c.Call.Return() - return c -} - -// Do rewrite *gomock.Call.Do -func (c *CounterIncCall) Do(f func()) *CounterIncCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *CounterIncCall) DoAndReturn(f func()) *CounterIncCall { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// MockUniqueCounter is a mock of UniqueCounter interface. -type MockUniqueCounter struct { - ctrl *gomock.Controller - recorder *MockUniqueCounterMockRecorder -} - -// MockUniqueCounterMockRecorder is the mock recorder for MockUniqueCounter. -type MockUniqueCounterMockRecorder struct { - mock *MockUniqueCounter -} - -// NewMockUniqueCounter creates a new mock instance. -func NewMockUniqueCounter(ctrl *gomock.Controller) *MockUniqueCounter { - mock := &MockUniqueCounter{ctrl: ctrl} - mock.recorder = &MockUniqueCounterMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockUniqueCounter) EXPECT() *MockUniqueCounterMockRecorder { - return m.recorder -} - -// Add mocks base method. -func (m *MockUniqueCounter) Add(arg0 int64) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Add", arg0) -} - -// Add indicates an expected call of Add. -func (mr *MockUniqueCounterMockRecorder) Add(arg0 any) *UniqueCounterAddCall { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockUniqueCounter)(nil).Add), arg0) - return &UniqueCounterAddCall{Call: call} -} - -// UniqueCounterAddCall wrap *gomock.Call -type UniqueCounterAddCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *UniqueCounterAddCall) Return() *UniqueCounterAddCall { - c.Call = c.Call.Return() - return c -} - -// Do rewrite *gomock.Call.Do -func (c *UniqueCounterAddCall) Do(f func(int64)) *UniqueCounterAddCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *UniqueCounterAddCall) DoAndReturn(f func(int64)) *UniqueCounterAddCall { - c.Call = c.Call.DoAndReturn(f) - return c -} diff --git a/internal/tool/testing/mock_tool/doc.go b/internal/tool/testing/mock_tool/doc.go index 11ec0448..78eb186a 100644 --- a/internal/tool/testing/mock_tool/doc.go +++ b/internal/tool/testing/mock_tool/doc.go @@ -1,3 +1,3 @@ -package mock_usage_metrics +package mock_tool -//go:generate mockgen.sh -destination "api.go" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics" "UsageTrackerInterface,Counter,UniqueCounter" +//go:generate mockgen.sh -destination "tool.go" -package "mock_tool" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz" "ErrReporter" diff --git a/internal/tool/testing/mock_tool/tool.go b/internal/tool/testing/mock_tool/tool.go new file mode 100644 index 00000000..425d4e58 --- /dev/null +++ b/internal/tool/testing/mock_tool/tool.go @@ -0,0 +1,76 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz (interfaces: ErrReporter) +// +// Generated by this command: +// +// mockgen -typed -destination tool.go -package mock_tool gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz ErrReporter +// +// Package mock_tool is a generated GoMock package. +package mock_tool + +import ( + context "context" + reflect "reflect" + + gomock "go.uber.org/mock/gomock" + zap "go.uber.org/zap" +) + +// MockErrReporter is a mock of ErrReporter interface. +type MockErrReporter struct { + ctrl *gomock.Controller + recorder *MockErrReporterMockRecorder +} + +// MockErrReporterMockRecorder is the mock recorder for MockErrReporter. +type MockErrReporterMockRecorder struct { + mock *MockErrReporter +} + +// NewMockErrReporter creates a new mock instance. +func NewMockErrReporter(ctrl *gomock.Controller) *MockErrReporter { + mock := &MockErrReporter{ctrl: ctrl} + mock.recorder = &MockErrReporterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockErrReporter) EXPECT() *MockErrReporterMockRecorder { + return m.recorder +} + +// HandleProcessingError mocks base method. +func (m *MockErrReporter) HandleProcessingError(arg0 context.Context, arg1 *zap.Logger, arg2 string, arg3 error) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "HandleProcessingError", arg0, arg1, arg2, arg3) +} + +// HandleProcessingError indicates an expected call of HandleProcessingError. +func (mr *MockErrReporterMockRecorder) HandleProcessingError(arg0, arg1, arg2, arg3 any) *ErrReporterHandleProcessingErrorCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleProcessingError", reflect.TypeOf((*MockErrReporter)(nil).HandleProcessingError), arg0, arg1, arg2, arg3) + return &ErrReporterHandleProcessingErrorCall{Call: call} +} + +// ErrReporterHandleProcessingErrorCall wrap *gomock.Call +type ErrReporterHandleProcessingErrorCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *ErrReporterHandleProcessingErrorCall) Return() *ErrReporterHandleProcessingErrorCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *ErrReporterHandleProcessingErrorCall) Do(f func(context.Context, *zap.Logger, string, error)) *ErrReporterHandleProcessingErrorCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *ErrReporterHandleProcessingErrorCall) DoAndReturn(f func(context.Context, *zap.Logger, string, error)) *ErrReporterHandleProcessingErrorCall { + c.Call = c.Call.DoAndReturn(f) + return c +} diff --git a/internal/tool/testing/mock_usage_metrics/BUILD.bazel b/internal/tool/testing/mock_usage_metrics/BUILD.bazel index 4d607f3c..58691524 100644 --- a/internal/tool/testing/mock_usage_metrics/BUILD.bazel +++ b/internal/tool/testing/mock_usage_metrics/BUILD.bazel @@ -1,16 +1,16 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( - name = "mock_tool", + name = "mock_usage_metrics", testonly = True, srcs = [ + "api.go", "doc.go", - "tool.go", ], - importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_tool", + importpath = "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/testing/mock_usage_metrics", visibility = ["//:__subpackages__"], deps = [ + "//internal/module/usage_metrics", "@org_uber_go_mock//gomock", - "@org_uber_go_zap//:zap", ], ) diff --git a/internal/tool/testing/mock_usage_metrics/doc.go b/internal/tool/testing/mock_usage_metrics/doc.go index 78eb186a..11ec0448 100644 --- a/internal/tool/testing/mock_usage_metrics/doc.go +++ b/internal/tool/testing/mock_usage_metrics/doc.go @@ -1,3 +1,3 @@ -package mock_tool +package mock_usage_metrics -//go:generate mockgen.sh -destination "tool.go" -package "mock_tool" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz" "ErrReporter" +//go:generate mockgen.sh -destination "api.go" "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics" "UsageTrackerInterface,Counter,UniqueCounter" diff --git a/internal/tool/testing/mock_usage_metrics/tool.go b/internal/tool/testing/mock_usage_metrics/tool.go index 425d4e58..7882ae20 100644 --- a/internal/tool/testing/mock_usage_metrics/tool.go +++ b/internal/tool/testing/mock_usage_metrics/tool.go @@ -1,76 +1,307 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz (interfaces: ErrReporter) +// Source: gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics (interfaces: UsageTrackerInterface,Counter,UniqueCounter) // // Generated by this command: // -// mockgen -typed -destination tool.go -package mock_tool gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/tool/errz ErrReporter +// mockgen -typed -destination api.go gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics UsageTrackerInterface,Counter,UniqueCounter // -// Package mock_tool is a generated GoMock package. -package mock_tool +// Package mock_usage_metrics is a generated GoMock package. +package mock_usage_metrics import ( - context "context" reflect "reflect" + usage_metrics "gitlab.com/gitlab-org/cluster-integration/gitlab-agent/v16/internal/module/usage_metrics" gomock "go.uber.org/mock/gomock" - zap "go.uber.org/zap" ) -// MockErrReporter is a mock of ErrReporter interface. -type MockErrReporter struct { +// MockUsageTrackerInterface is a mock of UsageTrackerInterface interface. +type MockUsageTrackerInterface struct { ctrl *gomock.Controller - recorder *MockErrReporterMockRecorder + recorder *MockUsageTrackerInterfaceMockRecorder } -// MockErrReporterMockRecorder is the mock recorder for MockErrReporter. -type MockErrReporterMockRecorder struct { - mock *MockErrReporter +// MockUsageTrackerInterfaceMockRecorder is the mock recorder for MockUsageTrackerInterface. +type MockUsageTrackerInterfaceMockRecorder struct { + mock *MockUsageTrackerInterface } -// NewMockErrReporter creates a new mock instance. -func NewMockErrReporter(ctrl *gomock.Controller) *MockErrReporter { - mock := &MockErrReporter{ctrl: ctrl} - mock.recorder = &MockErrReporterMockRecorder{mock} +// NewMockUsageTrackerInterface creates a new mock instance. +func NewMockUsageTrackerInterface(ctrl *gomock.Controller) *MockUsageTrackerInterface { + mock := &MockUsageTrackerInterface{ctrl: ctrl} + mock.recorder = &MockUsageTrackerInterfaceMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockErrReporter) EXPECT() *MockErrReporterMockRecorder { +func (m *MockUsageTrackerInterface) EXPECT() *MockUsageTrackerInterfaceMockRecorder { return m.recorder } -// HandleProcessingError mocks base method. -func (m *MockErrReporter) HandleProcessingError(arg0 context.Context, arg1 *zap.Logger, arg2 string, arg3 error) { +// CloneUsageData mocks base method. +func (m *MockUsageTrackerInterface) CloneUsageData() *usage_metrics.UsageData { m.ctrl.T.Helper() - m.ctrl.Call(m, "HandleProcessingError", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "CloneUsageData") + ret0, _ := ret[0].(*usage_metrics.UsageData) + return ret0 } -// HandleProcessingError indicates an expected call of HandleProcessingError. -func (mr *MockErrReporterMockRecorder) HandleProcessingError(arg0, arg1, arg2, arg3 any) *ErrReporterHandleProcessingErrorCall { +// CloneUsageData indicates an expected call of CloneUsageData. +func (mr *MockUsageTrackerInterfaceMockRecorder) CloneUsageData() *UsageTrackerInterfaceCloneUsageDataCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleProcessingError", reflect.TypeOf((*MockErrReporter)(nil).HandleProcessingError), arg0, arg1, arg2, arg3) - return &ErrReporterHandleProcessingErrorCall{Call: call} + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloneUsageData", reflect.TypeOf((*MockUsageTrackerInterface)(nil).CloneUsageData)) + return &UsageTrackerInterfaceCloneUsageDataCall{Call: call} } -// ErrReporterHandleProcessingErrorCall wrap *gomock.Call -type ErrReporterHandleProcessingErrorCall struct { +// UsageTrackerInterfaceCloneUsageDataCall wrap *gomock.Call +type UsageTrackerInterfaceCloneUsageDataCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *ErrReporterHandleProcessingErrorCall) Return() *ErrReporterHandleProcessingErrorCall { +func (c *UsageTrackerInterfaceCloneUsageDataCall) Return(arg0 *usage_metrics.UsageData) *UsageTrackerInterfaceCloneUsageDataCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *UsageTrackerInterfaceCloneUsageDataCall) Do(f func() *usage_metrics.UsageData) *UsageTrackerInterfaceCloneUsageDataCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *UsageTrackerInterfaceCloneUsageDataCall) DoAndReturn(f func() *usage_metrics.UsageData) *UsageTrackerInterfaceCloneUsageDataCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// RegisterCounter mocks base method. +func (m *MockUsageTrackerInterface) RegisterCounter(arg0 string) usage_metrics.Counter { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterCounter", arg0) + ret0, _ := ret[0].(usage_metrics.Counter) + return ret0 +} + +// RegisterCounter indicates an expected call of RegisterCounter. +func (mr *MockUsageTrackerInterfaceMockRecorder) RegisterCounter(arg0 any) *UsageTrackerInterfaceRegisterCounterCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterCounter", reflect.TypeOf((*MockUsageTrackerInterface)(nil).RegisterCounter), arg0) + return &UsageTrackerInterfaceRegisterCounterCall{Call: call} +} + +// UsageTrackerInterfaceRegisterCounterCall wrap *gomock.Call +type UsageTrackerInterfaceRegisterCounterCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *UsageTrackerInterfaceRegisterCounterCall) Return(arg0 usage_metrics.Counter) *UsageTrackerInterfaceRegisterCounterCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *UsageTrackerInterfaceRegisterCounterCall) Do(f func(string) usage_metrics.Counter) *UsageTrackerInterfaceRegisterCounterCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *UsageTrackerInterfaceRegisterCounterCall) DoAndReturn(f func(string) usage_metrics.Counter) *UsageTrackerInterfaceRegisterCounterCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// RegisterUniqueCounter mocks base method. +func (m *MockUsageTrackerInterface) RegisterUniqueCounter(arg0 string) usage_metrics.UniqueCounter { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterUniqueCounter", arg0) + ret0, _ := ret[0].(usage_metrics.UniqueCounter) + return ret0 +} + +// RegisterUniqueCounter indicates an expected call of RegisterUniqueCounter. +func (mr *MockUsageTrackerInterfaceMockRecorder) RegisterUniqueCounter(arg0 any) *UsageTrackerInterfaceRegisterUniqueCounterCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterUniqueCounter", reflect.TypeOf((*MockUsageTrackerInterface)(nil).RegisterUniqueCounter), arg0) + return &UsageTrackerInterfaceRegisterUniqueCounterCall{Call: call} +} + +// UsageTrackerInterfaceRegisterUniqueCounterCall wrap *gomock.Call +type UsageTrackerInterfaceRegisterUniqueCounterCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *UsageTrackerInterfaceRegisterUniqueCounterCall) Return(arg0 usage_metrics.UniqueCounter) *UsageTrackerInterfaceRegisterUniqueCounterCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *UsageTrackerInterfaceRegisterUniqueCounterCall) Do(f func(string) usage_metrics.UniqueCounter) *UsageTrackerInterfaceRegisterUniqueCounterCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *UsageTrackerInterfaceRegisterUniqueCounterCall) DoAndReturn(f func(string) usage_metrics.UniqueCounter) *UsageTrackerInterfaceRegisterUniqueCounterCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// Subtract mocks base method. +func (m *MockUsageTrackerInterface) Subtract(arg0 *usage_metrics.UsageData) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Subtract", arg0) +} + +// Subtract indicates an expected call of Subtract. +func (mr *MockUsageTrackerInterfaceMockRecorder) Subtract(arg0 any) *UsageTrackerInterfaceSubtractCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subtract", reflect.TypeOf((*MockUsageTrackerInterface)(nil).Subtract), arg0) + return &UsageTrackerInterfaceSubtractCall{Call: call} +} + +// UsageTrackerInterfaceSubtractCall wrap *gomock.Call +type UsageTrackerInterfaceSubtractCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *UsageTrackerInterfaceSubtractCall) Return() *UsageTrackerInterfaceSubtractCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *UsageTrackerInterfaceSubtractCall) Do(f func(*usage_metrics.UsageData)) *UsageTrackerInterfaceSubtractCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *UsageTrackerInterfaceSubtractCall) DoAndReturn(f func(*usage_metrics.UsageData)) *UsageTrackerInterfaceSubtractCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// MockCounter is a mock of Counter interface. +type MockCounter struct { + ctrl *gomock.Controller + recorder *MockCounterMockRecorder +} + +// MockCounterMockRecorder is the mock recorder for MockCounter. +type MockCounterMockRecorder struct { + mock *MockCounter +} + +// NewMockCounter creates a new mock instance. +func NewMockCounter(ctrl *gomock.Controller) *MockCounter { + mock := &MockCounter{ctrl: ctrl} + mock.recorder = &MockCounterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockCounter) EXPECT() *MockCounterMockRecorder { + return m.recorder +} + +// Inc mocks base method. +func (m *MockCounter) Inc() { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Inc") +} + +// Inc indicates an expected call of Inc. +func (mr *MockCounterMockRecorder) Inc() *CounterIncCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Inc", reflect.TypeOf((*MockCounter)(nil).Inc)) + return &CounterIncCall{Call: call} +} + +// CounterIncCall wrap *gomock.Call +type CounterIncCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *CounterIncCall) Return() *CounterIncCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *CounterIncCall) Do(f func()) *CounterIncCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *CounterIncCall) DoAndReturn(f func()) *CounterIncCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// MockUniqueCounter is a mock of UniqueCounter interface. +type MockUniqueCounter struct { + ctrl *gomock.Controller + recorder *MockUniqueCounterMockRecorder +} + +// MockUniqueCounterMockRecorder is the mock recorder for MockUniqueCounter. +type MockUniqueCounterMockRecorder struct { + mock *MockUniqueCounter +} + +// NewMockUniqueCounter creates a new mock instance. +func NewMockUniqueCounter(ctrl *gomock.Controller) *MockUniqueCounter { + mock := &MockUniqueCounter{ctrl: ctrl} + mock.recorder = &MockUniqueCounterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockUniqueCounter) EXPECT() *MockUniqueCounterMockRecorder { + return m.recorder +} + +// Add mocks base method. +func (m *MockUniqueCounter) Add(arg0 int64) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Add", arg0) +} + +// Add indicates an expected call of Add. +func (mr *MockUniqueCounterMockRecorder) Add(arg0 any) *UniqueCounterAddCall { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockUniqueCounter)(nil).Add), arg0) + return &UniqueCounterAddCall{Call: call} +} + +// UniqueCounterAddCall wrap *gomock.Call +type UniqueCounterAddCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *UniqueCounterAddCall) Return() *UniqueCounterAddCall { c.Call = c.Call.Return() return c } // Do rewrite *gomock.Call.Do -func (c *ErrReporterHandleProcessingErrorCall) Do(f func(context.Context, *zap.Logger, string, error)) *ErrReporterHandleProcessingErrorCall { +func (c *UniqueCounterAddCall) Do(f func(int64)) *UniqueCounterAddCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *ErrReporterHandleProcessingErrorCall) DoAndReturn(f func(context.Context, *zap.Logger, string, error)) *ErrReporterHandleProcessingErrorCall { +func (c *UniqueCounterAddCall) DoAndReturn(f func(int64)) *UniqueCounterAddCall { c.Call = c.Call.DoAndReturn(f) return c }