From 6410c2df187932b7e9668a8409d9e2a952cc4c84 Mon Sep 17 00:00:00 2001 From: Yusuke Kato Date: Wed, 6 Dec 2023 11:04:20 +0900 Subject: [PATCH] update dependencies (#2260) * update dependencies Signed-off-by: kpango * re-generate test Signed-off-by: kpango * fix test generation for main package Signed-off-by: kpango --------- Signed-off-by: kpango --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .../ISSUE_TEMPLATE/security_issue_report.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- Makefile.d/test.mk | 3 + cmd/index/job/correction/main_test.go | 87 ++ cmd/index/job/creation/main_test.go | 87 ++ cmd/index/job/readreplica/rotate/main_test.go | 87 ++ cmd/index/job/save/main_test.go | 87 ++ cmd/tools/cli/benchmark/core/main_test.go | 117 ++- go.mod | 52 +- go.sum | 74 +- .../v1/client/agent/core/client_test.go | 230 +++++ internal/config/corrector_test.go | 36 +- internal/config/readreplica_rotate_test.go | 10 +- internal/k8s/client/client_test.go | 911 ++++++++++++++++++ internal/k8s/client/option_test.go | 102 ++ internal/net/grpc/client_test.go | 279 +++++- internal/net/grpc/proto/proto_test.go | 86 ++ internal/net/grpc/stream_test.go | 89 -- .../index/job/correction/correction_test.go | 294 ++++++ .../metrics/mem/malloc/malloc_test.go | 13 + .../core/ngt/handler/grpc/object_test.go | 9 +- pkg/gateway/lb/handler/grpc/handler_test.go | 134 +++ .../job/correction/service/corrector_test.go | 48 +- .../job/correction/service/options_test.go | 4 +- .../readreplica/rotate/usecase/rotate_test.go | 106 ++ versions/GO_VERSION | 2 +- versions/K3S_VERSION | 2 +- versions/PROMETHEUS_STACK_VERSION | 2 +- versions/YQ_VERSION | 2 +- 30 files changed, 2694 insertions(+), 265 deletions(-) create mode 100644 cmd/index/job/correction/main_test.go create mode 100644 cmd/index/job/creation/main_test.go create mode 100644 cmd/index/job/readreplica/rotate/main_test.go create mode 100644 cmd/index/job/save/main_test.go create mode 100644 internal/k8s/client/client_test.go create mode 100644 internal/k8s/client/option_test.go create mode 100644 internal/observability/metrics/index/job/correction/correction_test.go create mode 100644 pkg/index/job/readreplica/rotate/usecase/rotate_test.go diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0b25fda687d..eb234c7e5c8 100755 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -22,7 +22,7 @@ assignees: "" -- Go Version: 1.21.4 +- Go Version: 1.21.5 - Docker Version: 20.10.8 - Kubernetes Version: v1.28.4 - NGT Version: 2.1.5 diff --git a/.github/ISSUE_TEMPLATE/security_issue_report.md b/.github/ISSUE_TEMPLATE/security_issue_report.md index 7425c15051e..8051c1dee98 100644 --- a/.github/ISSUE_TEMPLATE/security_issue_report.md +++ b/.github/ISSUE_TEMPLATE/security_issue_report.md @@ -16,7 +16,7 @@ assignees: "" -- Go Version: 1.21.4 +- Go Version: 1.21.5 - Docker Version: 20.10.8 - Kubernetes Version: v1.28.4 - NGT Version: 2.1.5 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index dd86efcc257..2bc3c8b614e 100755 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,7 +16,7 @@ -- Go Version: 1.21.4 +- Go Version: 1.21.5 - Docker Version: 20.10.8 - Kubernetes Version: v1.28.4 - NGT Version: 2.1.5 diff --git a/Makefile.d/test.mk b/Makefile.d/test.mk index af563f3e23d..a8b26b252bb 100644 --- a/Makefile.d/test.mk +++ b/Makefile.d/test.mk @@ -200,6 +200,9 @@ test/create-empty: echo "Creating empty test file $$f"; \ package="$$(dirname $$f)" ; \ package="$$(basename $$package)" ; \ + if [ "$$(basename $$f)" = "main.go" ]; then \ + package="main"; \ + fi; \ echo "package $$package" >> "$$f"; \ fi; \ done diff --git a/cmd/index/job/correction/main_test.go b/cmd/index/job/correction/main_test.go new file mode 100644 index 00000000000..2f827f96157 --- /dev/null +++ b/cmd/index/job/correction/main_test.go @@ -0,0 +1,87 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package main + +// NOT IMPLEMENTED BELOW +// +// func Test_main(t *testing.T) { +// type want struct { +// } +// type test struct { +// name string +// want want +// checkFunc func(want) error +// beforeFunc func(*testing.T) +// afterFunc func(*testing.T) +// } +// defaultCheckFunc := func(w want) error { +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// main() +// if err := checkFunc(test.want); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } diff --git a/cmd/index/job/creation/main_test.go b/cmd/index/job/creation/main_test.go new file mode 100644 index 00000000000..2f827f96157 --- /dev/null +++ b/cmd/index/job/creation/main_test.go @@ -0,0 +1,87 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package main + +// NOT IMPLEMENTED BELOW +// +// func Test_main(t *testing.T) { +// type want struct { +// } +// type test struct { +// name string +// want want +// checkFunc func(want) error +// beforeFunc func(*testing.T) +// afterFunc func(*testing.T) +// } +// defaultCheckFunc := func(w want) error { +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// main() +// if err := checkFunc(test.want); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } diff --git a/cmd/index/job/readreplica/rotate/main_test.go b/cmd/index/job/readreplica/rotate/main_test.go new file mode 100644 index 00000000000..2f827f96157 --- /dev/null +++ b/cmd/index/job/readreplica/rotate/main_test.go @@ -0,0 +1,87 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package main + +// NOT IMPLEMENTED BELOW +// +// func Test_main(t *testing.T) { +// type want struct { +// } +// type test struct { +// name string +// want want +// checkFunc func(want) error +// beforeFunc func(*testing.T) +// afterFunc func(*testing.T) +// } +// defaultCheckFunc := func(w want) error { +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// main() +// if err := checkFunc(test.want); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } diff --git a/cmd/index/job/save/main_test.go b/cmd/index/job/save/main_test.go new file mode 100644 index 00000000000..2f827f96157 --- /dev/null +++ b/cmd/index/job/save/main_test.go @@ -0,0 +1,87 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package main + +// NOT IMPLEMENTED BELOW +// +// func Test_main(t *testing.T) { +// type want struct { +// } +// type test struct { +// name string +// want want +// checkFunc func(want) error +// beforeFunc func(*testing.T) +// afterFunc func(*testing.T) +// } +// defaultCheckFunc := func(w want) error { +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// main() +// if err := checkFunc(test.want); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } diff --git a/cmd/tools/cli/benchmark/core/main_test.go b/cmd/tools/cli/benchmark/core/main_test.go index 8d8297becb7..ef86d3b0a62 100644 --- a/cmd/tools/cli/benchmark/core/main_test.go +++ b/cmd/tools/cli/benchmark/core/main_test.go @@ -88,8 +88,14 @@ package main // // func Test_run(t *testing.T) { // type args struct { -// dur time.Duration -// output func(header string) +// ctx context.Context +// load bool +// path string +// dim int +// vectors [][]float32 +// ids []uint +// dur time.Duration +// output func(header string) // } // type want struct { // } @@ -110,6 +116,12 @@ package main // { // name: "test_case_1", // args: args { +// ctx:nil, +// load:false, +// path:"", +// dim:0, +// vectors:nil, +// ids:nil, // dur:nil, // output:nil, // }, @@ -130,6 +142,12 @@ package main // return test { // name: "test_case_2", // args: args { +// ctx:nil, +// load:false, +// path:"", +// dim:0, +// vectors:nil, +// ids:nil, // dur:nil, // output:nil, // }, @@ -162,7 +180,100 @@ package main // checkFunc = defaultCheckFunc // } // -// run(test.args.dur, test.args.output) +// run(test.args.ctx, test.args.load, test.args.path, test.args.dim, test.args.vectors, test.args.ids, test.args.dur, test.args.output) +// if err := checkFunc(test.want); err != nil { +// tt.Errorf("error = %v", err) +// } +// }) +// } +// } +// +// func Test_sleep(t *testing.T) { +// type args struct { +// ctx context.Context +// duration time.Duration +// limit time.Duration +// fn func() +// efn func() +// } +// type want struct { +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want) error { +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// duration:nil, +// limit:nil, +// fn:nil, +// efn:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// duration:nil, +// limit:nil, +// fn:nil, +// efn:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// sleep(test.args.ctx, test.args.duration, test.args.limit, test.args.fn, test.args.efn) // if err := checkFunc(test.want); err != nil { // tt.Errorf("error = %v", err) // } diff --git a/go.mod b/go.mod index 498655f0bfc..1cfee3fb126 100755 --- a/go.mod +++ b/go.mod @@ -36,35 +36,35 @@ replace ( github.com/Azure/go-autorest/tracing => github.com/Azure/go-autorest/tracing v0.6.1-0.20230905222633-df94ce56f001 github.com/BurntSushi/toml => github.com/BurntSushi/toml v1.3.2 github.com/DATA-DOG/go-sqlmock => github.com/DATA-DOG/go-sqlmock v1.5.0 - github.com/GoogleCloudPlatform/cloudsql-proxy => github.com/GoogleCloudPlatform/cloudsql-proxy v1.33.14 + github.com/GoogleCloudPlatform/cloudsql-proxy => github.com/GoogleCloudPlatform/cloudsql-proxy v1.33.15 github.com/Masterminds/semver/v3 => github.com/Masterminds/semver/v3 v3.2.1 github.com/ajstarks/deck => github.com/ajstarks/deck v0.0.0-20231012031509-f833e437b68a github.com/ajstarks/deck/generate => github.com/ajstarks/deck/generate v0.0.0-20231012031509-f833e437b68a github.com/ajstarks/svgo => github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b github.com/antihax/optional => github.com/antihax/optional v1.0.0 github.com/armon/go-socks5 => github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 - github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.48.10 - github.com/aws/aws-sdk-go-v2 => github.com/aws/aws-sdk-go-v2 v1.23.4 + github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.48.13 + github.com/aws/aws-sdk-go-v2 => github.com/aws/aws-sdk-go-v2 v1.23.5 github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream => github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.3 - github.com/aws/aws-sdk-go-v2/config => github.com/aws/aws-sdk-go-v2/config v1.25.10 - github.com/aws/aws-sdk-go-v2/credentials => github.com/aws/aws-sdk-go-v2/credentials v1.16.8 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds => github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.8 - github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.3 - github.com/aws/aws-sdk-go-v2/internal/configsources => github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.7 - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.7 + github.com/aws/aws-sdk-go-v2/config => github.com/aws/aws-sdk-go-v2/config v1.25.11 + github.com/aws/aws-sdk-go-v2/credentials => github.com/aws/aws-sdk-go-v2/credentials v1.16.9 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds => github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.9 + github.com/aws/aws-sdk-go-v2/feature/s3/manager => github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.4 + github.com/aws/aws-sdk-go-v2/internal/configsources => github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.8 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.8 github.com/aws/aws-sdk-go-v2/internal/ini => github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding => github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3 - github.com/aws/aws-sdk-go-v2/service/internal/checksum => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.7 - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url => github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.7 - github.com/aws/aws-sdk-go-v2/service/internal/s3shared => github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.7 - github.com/aws/aws-sdk-go-v2/service/kms => github.com/aws/aws-sdk-go-v2/service/kms v1.27.1 - github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.47.1 - github.com/aws/aws-sdk-go-v2/service/secretsmanager => github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.25.1 - github.com/aws/aws-sdk-go-v2/service/sns => github.com/aws/aws-sdk-go-v2/service/sns v1.26.1 - github.com/aws/aws-sdk-go-v2/service/sqs => github.com/aws/aws-sdk-go-v2/service/sqs v1.29.1 - github.com/aws/aws-sdk-go-v2/service/ssm => github.com/aws/aws-sdk-go-v2/service/ssm v1.44.1 - github.com/aws/aws-sdk-go-v2/service/sso => github.com/aws/aws-sdk-go-v2/service/sso v1.18.1 - github.com/aws/aws-sdk-go-v2/service/sts => github.com/aws/aws-sdk-go-v2/service/sts v1.26.1 + github.com/aws/aws-sdk-go-v2/service/internal/checksum => github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.8 + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url => github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.8 + github.com/aws/aws-sdk-go-v2/service/internal/s3shared => github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.8 + github.com/aws/aws-sdk-go-v2/service/kms => github.com/aws/aws-sdk-go-v2/service/kms v1.27.2 + github.com/aws/aws-sdk-go-v2/service/s3 => github.com/aws/aws-sdk-go-v2/service/s3 v1.47.2 + github.com/aws/aws-sdk-go-v2/service/secretsmanager => github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.25.2 + github.com/aws/aws-sdk-go-v2/service/sns => github.com/aws/aws-sdk-go-v2/service/sns v1.26.2 + github.com/aws/aws-sdk-go-v2/service/sqs => github.com/aws/aws-sdk-go-v2/service/sqs v1.29.2 + github.com/aws/aws-sdk-go-v2/service/ssm => github.com/aws/aws-sdk-go-v2/service/ssm v1.44.2 + github.com/aws/aws-sdk-go-v2/service/sso => github.com/aws/aws-sdk-go-v2/service/sso v1.18.2 + github.com/aws/aws-sdk-go-v2/service/sts => github.com/aws/aws-sdk-go-v2/service/sts v1.26.2 github.com/aws/smithy-go => github.com/aws/smithy-go v1.18.1 github.com/benbjohnson/clock => github.com/benbjohnson/clock v1.3.5 github.com/beorn7/perks => github.com/beorn7/perks v1.0.1 @@ -101,7 +101,7 @@ replace ( github.com/gin-contrib/sse => github.com/gin-contrib/sse v0.1.0 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 github.com/go-errors/errors => github.com/go-errors/errors v1.5.1 - github.com/go-fonts/dejavu => github.com/go-fonts/dejavu v0.3.2 + github.com/go-fonts/dejavu => github.com/go-fonts/dejavu v0.3.3 github.com/go-fonts/latin-modern => github.com/go-fonts/latin-modern v0.3.2 github.com/go-fonts/liberation => github.com/go-fonts/liberation v0.3.2 github.com/go-fonts/stix => github.com/go-fonts/stix v0.2.2 @@ -153,7 +153,7 @@ replace ( github.com/google/gofuzz => github.com/google/gofuzz v1.2.0 github.com/google/martian => github.com/google/martian v2.1.0+incompatible github.com/google/martian/v3 => github.com/google/martian/v3 v3.3.2 - github.com/google/pprof => github.com/google/pprof v0.0.0-20231127191134-f3a68a39ae15 + github.com/google/pprof => github.com/google/pprof v0.0.0-20231205033806-a5a03c77bf08 github.com/google/shlex => github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/subcommands => github.com/google/subcommands v1.2.0 github.com/google/uuid => github.com/google/uuid v1.4.0 @@ -176,7 +176,7 @@ replace ( github.com/jackc/pgmock => github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 github.com/jackc/pgpassfile => github.com/jackc/pgpassfile v1.0.0 github.com/jackc/pgproto3/v2 => github.com/jackc/pgproto3/v2 v2.3.2 - github.com/jackc/pgservicefile => github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a + github.com/jackc/pgservicefile => github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 github.com/jackc/pgtype => github.com/jackc/pgtype v1.14.0 github.com/jackc/pgx/v4 => github.com/jackc/pgx/v4 v4.18.1 github.com/jackc/puddle => github.com/jackc/puddle v1.3.0 @@ -190,7 +190,7 @@ replace ( github.com/jstemmer/go-junit-report => github.com/jstemmer/go-junit-report v1.0.0 github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.6.3 github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0 - github.com/klauspost/compress => github.com/klauspost/compress v1.17.4-0.20231129132359-98ff542abe31 + github.com/klauspost/compress => github.com/klauspost/compress v1.17.5-0.20231201163758-1dba04a766e8 github.com/klauspost/cpuid/v2 => github.com/klauspost/cpuid/v2 v2.2.6 github.com/kpango/fastime => github.com/kpango/fastime v1.1.9 github.com/kpango/fuid => github.com/kpango/fuid v0.0.0-20221203053508-503b5ad89aa1 @@ -312,7 +312,7 @@ replace ( gonum.org/v1/gonum => gonum.org/v1/gonum v0.14.0 gonum.org/v1/hdf5 => gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 gonum.org/v1/plot => gonum.org/v1/plot v0.14.0 - google.golang.org/api => google.golang.org/api v0.152.0 + google.golang.org/api => google.golang.org/api v0.153.0 google.golang.org/appengine => google.golang.org/appengine v1.6.8 google.golang.org/genproto => google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4 google.golang.org/genproto/googleapis/api => google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 @@ -515,4 +515,4 @@ require ( sigs.k8s.io/kustomize/kyaml v0.14.1 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect -) \ No newline at end of file +) diff --git a/go.sum b/go.sum index fd534d2b844..43480394940 100644 --- a/go.sum +++ b/go.sum @@ -177,44 +177,44 @@ github.com/apache/arrow/go/v12 v12.0.0/go.mod h1:d+tV/eHZZ7Dz7RPrFKtPK02tpr+c9/P github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aws/aws-sdk-go v1.48.10 h1:0LIFG3wp2Dt6PsxKWCg1Y1xRrn2vZnW5/gWdgaBalKg= -github.com/aws/aws-sdk-go v1.48.10/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= -github.com/aws/aws-sdk-go-v2 v1.23.4 h1:2P20ZjH0ouSAu/6yZep8oCmTReathLuEu6dwoqEgjts= -github.com/aws/aws-sdk-go-v2 v1.23.4/go.mod h1:t3szzKfP0NeRU27uBFczDivYJjsmSnqI8kIvKyWb9ds= +github.com/aws/aws-sdk-go v1.48.13 h1:6N4GTme6MpxfCisWf5pql8k3TBORiKTmbeutZCDXlG8= +github.com/aws/aws-sdk-go v1.48.13/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go-v2 v1.23.5 h1:xK6C4udTyDMd82RFvNkDQxtAd00xlzFUtX4fF2nMZyg= +github.com/aws/aws-sdk-go-v2 v1.23.5/go.mod h1:t3szzKfP0NeRU27uBFczDivYJjsmSnqI8kIvKyWb9ds= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.3 h1:Zx9+31KyB8wQna6SXFWOewlgoY5uGdDAu6PTOEU3OQI= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.3/go.mod h1:zxbEJhRdKTH1nqS2qu6UJ7zGe25xaHxZXaC2CvuQFnA= -github.com/aws/aws-sdk-go-v2/config v1.25.10 h1:qw/e8emDtNufTkrAU86DlQ18DruMyyM7ttW6Lgwp4v0= -github.com/aws/aws-sdk-go-v2/config v1.25.10/go.mod h1:203YiAtb6XyoGxXMPsUVwEcuxCiTQY/r8P27IDjfvMc= -github.com/aws/aws-sdk-go-v2/credentials v1.16.8 h1:phw9nRLy/77bPk6Mfu2SHCOnHwfVB7WWrOa5rZIY2Fc= -github.com/aws/aws-sdk-go-v2/credentials v1.16.8/go.mod h1:MrS4SOin6adbO6wgWhdifyPiq+TX7fPPwyA/ZLC1F5M= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.8 h1:tQZLSPC2Zj2CqZHonLmWEvCsbpMX5tQvaYJWHadcPek= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.8/go.mod h1:5+YpvTHDFffykWr5qAGjqwoh8oVYZOddL3sSrEN7lws= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.3 h1:0Pw2ku539I0EugduMpJ+579WRc+38nv8rZhThWjsuYQ= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.3/go.mod h1:vQtGu6huTQkoEhNgkDeijtYm9Y8HgpQqvGeKUPoEunY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.7 h1:eMqD7ku6WGdmcWWXPYun9m6yk6feSULLhJlAtN6rYG4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.7/go.mod h1:0oBIfcDV6LScxEW0VgOqxT3e4aqKRp+SYhB9wAd5E3Q= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.7 h1:+XYhWhgWs5F3Zx8oa49CXzNvfXrItaDjZB/M172fcHQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.7/go.mod h1:L6tcSRyCGxcKfDWUrmv2jv8G1cLDU7d0FUpEFpG9bVE= +github.com/aws/aws-sdk-go-v2/config v1.25.11 h1:RWzp7jhPRliIcACefGkKp03L0Yofmd2p8M25kbiyvno= +github.com/aws/aws-sdk-go-v2/config v1.25.11/go.mod h1:BVUs0chMdygHsQtvaMyEOpW2GIW+ubrxJLgIz/JU29s= +github.com/aws/aws-sdk-go-v2/credentials v1.16.9 h1:LQo3MUIOzod9JdUK+wxmSdgzLVYUbII3jXn3S/HJZU0= +github.com/aws/aws-sdk-go-v2/credentials v1.16.9/go.mod h1:R7mDuIJoCjH6TxGUc/cylE7Lp/o0bhKVoxdBThsjqCM= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.9 h1:FZVFahMyZle6WcogZCOxo6D/lkDA2lqKIn4/ueUmVXw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.9/go.mod h1:kjq7REMIkxdtcEC9/4BVXjOsNY5isz6jQbEgk6osRTU= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.4 h1:TUCNKBd4/JEefsZDxo5deRmrRRPZHqGyBYiUAeBKOWU= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.4/go.mod h1:egDkcl+zsgFqS6VO142bKboip5Pe1sNMwN55Xy38QsM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.8 h1:8GVZIR0y6JRIUNSYI1xAMF4HDfV8H/bOsZ/8AD/uY5Q= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.8/go.mod h1:rwBfu0SoUkBUZndVgPZKAD9Y2JigaZtRP68unRiYToQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.8 h1:ZE2ds/qeBkhk3yqYvS3CDCFNvd9ir5hMjlVStLZWrvM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.8/go.mod h1:/lAPPymDYL023+TS6DJmjuL42nxix2AvEvfjqOBRODk= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1 h1:uR9lXYjdPX0xY+NhvaJ4dD8rpSRz5VY81ccIIoNG+lw= github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.0 h1:U5yySdwt2HPo/pnQec04DImLzWORbeWML1fJiLkKruI= github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.0/go.mod h1:EhC/83j8/hL/UB1WmExo3gkElaja/KlmZM/gl1rTfjM= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3 h1:e3PCNeEaev/ZF01cQyNZgmYE9oYYePIMJs2mWSKG514= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.3/go.mod h1:gIeeNyaL8tIEqZrzAnTeyhHcE0yysCtcaP+N9kxLZ+E= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.7 h1:Mft1tmIK1fkFS9l9sYVYiN+OdgXeOcQ9ZS3SxKOh3A4= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.7/go.mod h1:QWI83fhocxDaN3b74N8rrvET60CBaike5lQ+5sm3OcE= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.7 h1:dU+ZyhvqMB/T/TxjGagHMCdyUiqaThRIaMu3YvKiSQI= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.7/go.mod h1:SGORuNqoXyWfTvTp/gBGJfv8jRvW/+nha0XhnIXVI+o= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.7 h1:ybtGXm0qFVFi0hFUF7eFAVnL3ntl9MO7lrxhhGP7KYU= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.7/go.mod h1:BUyWJUKAnNqoEq1LfyQxy+Eh4U8Y3c5w2C6m21f3yvI= -github.com/aws/aws-sdk-go-v2/service/s3 v1.47.1 h1:0/W5F+LlXzKZ7KTsRcD8pugasVnsrjUWmhOsN/LdSFY= -github.com/aws/aws-sdk-go-v2/service/s3 v1.47.1/go.mod h1:TqThLn4bRCn/UYf960hNZgPPjmxc17fQcwmjfuG6D5k= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.1 h1:V40g2daNO3l1J94JYwqfkyvQMYXi5I25fs3fNQW8iDs= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.1/go.mod h1:0ZWQJP/mBOUxkCvZKybZNz1XmdUKSBxoF0dzgfxtvDs= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.8 h1:xyfOAYV/ujzZOo01H9+OnyeiRKmTEp6EsITTsmq332Q= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.8/go.mod h1:coLeQEoKzW9ViTL2bn0YUlU7K0RYjivKudG74gtd+sI= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.8 h1:EamsKe+ZjkOQjDdHd86/JCEucjFKQ9T0atWKO4s2Lgs= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.8/go.mod h1:Q0vV3/csTpbkfKLI5Sb56cJQTCTtJ0ixdb7P+Wedqiw= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.8 h1:ip5ia3JOXl4OAsqeTdrOOmqKgoWiu+t9XSOnRzBwmRs= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.8/go.mod h1:kE+aERnK9VQIw1vrk7ElAvhCsgLNzGyCPNg2Qe4Eq4c= +github.com/aws/aws-sdk-go-v2/service/s3 v1.47.2 h1:DLSAG8zpJV2pYsU+UPkj1IEZghyBnnUsvIRs6UuXSDU= +github.com/aws/aws-sdk-go-v2/service/s3 v1.47.2/go.mod h1:thjZng67jGsvMyVZnSxlcqKyLwB0XTG8bHIRZPTJ+Bs= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.2 h1:xJPydhNm0Hiqct5TVKEuHG7weC0+sOs4MUnd7A5n5F4= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.2/go.mod h1:zxk6y1X2KXThESWMS5CrKRvISD8mbIMab6nZrCGxDG0= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.1 h1:hd0SKLMdOL/Sl6Z0np1PX9LeH2gqNtBe0MhTedA8MGI= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.1/go.mod h1:XO/VcyoQ8nKyKfFW/3DMsRQXsfh/052tHTWmg3xBXRg= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.1 h1:K33V7L0XDdb23FMOZySr8bon1jou5SHn1fiv7NJ1SUg= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.1/go.mod h1:YtXUl/sfnS06VksYhr855hTQf2HphfT1Xv/EwuzbPjg= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.2 h1:fFrLsy08wEbAisqW3KDl/cPHrF43GmV79zXB9EwJiZw= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.2/go.mod h1:7Ld9eTqocTvJqqJ5K/orbSDwmGcpRdlDiLjz2DO+SL8= github.com/aws/smithy-go v1.18.1 h1:pOdBTUfXNazOlxLrgeYalVnuTpKreACHtc62xLwIB3c= github.com/aws/smithy-go v1.18.1/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -273,8 +273,8 @@ github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2/go.mod h1:eO7W361vml github.com/fyne-io/mobile v0.1.2/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY= github.com/go-errors/errors v1.5.1 h1:ZwEMSLRCapFLflTpT7NKaAc7ukJ8ZPEjzlxt8rPN8bk= github.com/go-errors/errors v1.5.1/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= -github.com/go-fonts/dejavu v0.3.2 h1:3XlHi0JBYX+Cp8n98c6qSoHrxPa4AUKDMKdrh/0sUdk= -github.com/go-fonts/dejavu v0.3.2/go.mod h1:m+TzKY7ZEl09/a17t1593E4VYW8L1VaBXHzFZOIjGEY= +github.com/go-fonts/dejavu v0.3.3 h1:YZxbkwCBqVC0BojBvGdDdQuDqtm0oRs95eGhSPYbTvg= +github.com/go-fonts/dejavu v0.3.3/go.mod h1:EpsVvJxpY/lRM2MbkThHF/5161F8YZdBFIC9uT3/Uqc= github.com/go-fonts/latin-modern v0.3.2 h1:M+Sq24Dp0ZRPf3TctPnG1MZxRblqyWC/cRUL9WmdaFc= github.com/go-fonts/latin-modern v0.3.2/go.mod h1:9odJt4NbRrbdj4UAMuLVd4zEukf6aAEKnDaQga0whqQ= github.com/go-fonts/liberation v0.3.2 h1:XuwG0vGHFBPRRI8Qwbi5tIvR3cku9LUfZGq/Ar16wlQ= @@ -362,8 +362,8 @@ 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/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20231127191134-f3a68a39ae15 h1:t2sLhFuGXwoomaKLTuoxFfFqqlG1Gp2DpsupXq3UvZ0= -github.com/google/pprof v0.0.0-20231127191134-f3a68a39ae15/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20231205033806-a5a03c77bf08 h1:PxlBVtIFHR/mtWk2i0gTEdCz+jBnqiuHNSki0epDbVs= +github.com/google/pprof v0.0.0-20231205033806-a5a03c77bf08/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= @@ -427,8 +427,8 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:C github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.17.4-0.20231129132359-98ff542abe31 h1:K0/QUfQaM8wgPJImX6Kh1KTmIDxH6WdjNV3IW8kqnKY= -github.com/klauspost/compress v1.17.4-0.20231129132359-98ff542abe31/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.5-0.20231201163758-1dba04a766e8 h1:UN1vYGdKhIhnw2KbHhwx+3Mux91UcMfYKwlXRJCgs58= +github.com/klauspost/compress v1.17.5-0.20231201163758-1dba04a766e8/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/kpango/fastime v1.1.9 h1:xVQHcqyPt5M69DyFH7g1EPRns1YQNap9d5eLhl/Jy84= @@ -653,8 +653,8 @@ gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENE gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I= gonum.org/v1/plot v0.14.0 h1:+LBDVFYwFe4LHhdP8coW6296MBEY4nQ+Y4vuUpJopcE= gonum.org/v1/plot v0.14.0/go.mod h1:MLdR9424SJed+5VqC6MsouEpig9pZX2VZ57H9ko2bXU= -google.golang.org/api v0.152.0 h1:t0r1vPnfMc260S2Ci+en7kfCZaLOPs5KI0sVV/6jZrY= -google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= +google.golang.org/api v0.153.0 h1:N1AwGhielyKFaUqH07/ZSIQR3uNPcV7NVw0vj+j4iR4= +google.golang.org/api v0.153.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4 h1:W12Pwm4urIbRdGhMEg2NM9O3TWKjNcxQhs46V0ypf/k= @@ -760,4 +760,4 @@ sigs.k8s.io/kustomize/kyaml v0.14.1/go.mod h1:AN1/IpawKilWD7V+YvQwRGUvuUOOWpjsHu sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= \ No newline at end of file +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/internal/client/v1/client/agent/core/client_test.go b/internal/client/v1/client/agent/core/client_test.go index 22fbde67dfb..2782ae2fc15 100644 --- a/internal/client/v1/client/agent/core/client_test.go +++ b/internal/client/v1/client/agent/core/client_test.go @@ -675,6 +675,123 @@ package core // } // } // +// func Test_agentClient_GetTimestamp(t *testing.T) { +// type args struct { +// ctx context.Context +// req *client.ObjectGetTimestampRequest +// in2 []grpc.CallOption +// } +// type fields struct { +// Client vald.Client +// addrs []string +// c grpc.Client +// } +// type want struct { +// wantRes *client.ObjectTimestamp +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *client.ObjectTimestamp, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *client.ObjectTimestamp, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(gotRes, w.wantRes) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// req:nil, +// in2:nil, +// }, +// fields: fields { +// Client:nil, +// addrs:nil, +// c:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// req:nil, +// in2:nil, +// }, +// fields: fields { +// Client:nil, +// addrs:nil, +// c:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &agentClient{ +// Client: test.fields.Client, +// addrs: test.fields.addrs, +// c: test.fields.c, +// } +// +// gotRes, err := c.GetTimestamp(test.args.ctx, test.args.req, test.args.in2...) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// // func Test_singleAgentClient_CreateIndex(t *testing.T) { // type args struct { // ctx context.Context @@ -1126,3 +1243,116 @@ package core // }) // } // } +// +// func Test_singleAgentClient_GetTimestamp(t *testing.T) { +// type args struct { +// ctx context.Context +// req *client.ObjectGetTimestampRequest +// opts []grpc.CallOption +// } +// type fields struct { +// Client vald.Client +// ac agent.AgentClient +// } +// type want struct { +// wantRes *client.ObjectTimestamp +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, *client.ObjectTimestamp, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, gotRes *client.ObjectTimestamp, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(gotRes, w.wantRes) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// req:nil, +// opts:nil, +// }, +// fields: fields { +// Client:nil, +// ac:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// req:nil, +// opts:nil, +// }, +// fields: fields { +// Client:nil, +// ac:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &singleAgentClient{ +// Client: test.fields.Client, +// ac: test.fields.ac, +// } +// +// gotRes, err := c.GetTimestamp(test.args.ctx, test.args.req, test.args.opts...) +// if err := checkFunc(test.want, gotRes, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/internal/config/corrector_test.go b/internal/config/corrector_test.go index a0725a19d7e..27751abb0fe 100644 --- a/internal/config/corrector_test.go +++ b/internal/config/corrector_test.go @@ -17,15 +17,15 @@ package config // // func TestCorrector_Bind(t *testing.T) { // type fields struct { -// AgentPort int -// AgentName string -// AgentNamespace string -// AgentDNS string -// NodeName string -// StreamListConcurrency int -// KvsAsyncWriteConcurrency int -// IndexReplica int -// Discoverer *DiscovererClient +// AgentPort int +// AgentName string +// AgentNamespace string +// AgentDNS string +// NodeName string +// StreamListConcurrency int +// KvsAsyncWriteConcurrency int +// IndexReplica int +// Discoverer *DiscovererClient // } // type want struct { // want *Corrector @@ -116,15 +116,15 @@ package config // checkFunc = defaultCheckFunc // } // c := &Corrector{ -// AgentPort: test.fields.AgentPort, -// AgentName: test.fields.AgentName, -// AgentNamespace: test.fields.AgentNamespace, -// AgentDNS: test.fields.AgentDNS, -// NodeName: test.fields.NodeName, -// StreamListConcurrency: test.fields.StreamListConcurrency, -// KvsAsyncWriteConcurrency: test.fields.KvsAsyncWriteConcurrency, -// IndexReplica: test.fields.IndexReplica, -// Discoverer: test.fields.Discoverer, +// AgentPort: test.fields.AgentPort, +// AgentName: test.fields.AgentName, +// AgentNamespace: test.fields.AgentNamespace, +// AgentDNS: test.fields.AgentDNS, +// NodeName: test.fields.NodeName, +// StreamListConcurrency: test.fields.StreamListConcurrency, +// KvsAsyncWriteConcurrency: test.fields.KvsAsyncWriteConcurrency, +// IndexReplica: test.fields.IndexReplica, +// Discoverer: test.fields.Discoverer, // } // // got := c.Bind() diff --git a/internal/config/readreplica_rotate_test.go b/internal/config/readreplica_rotate_test.go index 586eff9162a..cdf0458f125 100644 --- a/internal/config/readreplica_rotate_test.go +++ b/internal/config/readreplica_rotate_test.go @@ -15,7 +15,7 @@ package config // NOT IMPLEMENTED BELOW // -// func TestReadreplicaRotate_Bind(t *testing.T) { +// func TestReadReplicaRotate_Bind(t *testing.T) { // type fields struct { // AgentNamespace string // ReadReplicaLabelKey string @@ -23,17 +23,17 @@ package config // VolumeName string // } // type want struct { -// want *ReadreplicaRotate +// want *ReadReplicaRotate // } // type test struct { // name string // fields fields // want want -// checkFunc func(want, *ReadreplicaRotate) error +// checkFunc func(want, *ReadReplicaRotate) error // beforeFunc func(*testing.T) // afterFunc func(*testing.T) // } -// defaultCheckFunc := func(w want, got *ReadreplicaRotate) error { +// defaultCheckFunc := func(w want, got *ReadReplicaRotate) error { // if !reflect.DeepEqual(got, w.want) { // return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) // } @@ -100,7 +100,7 @@ package config // if test.checkFunc == nil { // checkFunc = defaultCheckFunc // } -// r := &ReadreplicaRotate{ +// r := &ReadReplicaRotate{ // AgentNamespace: test.fields.AgentNamespace, // ReadReplicaLabelKey: test.fields.ReadReplicaLabelKey, // ReadReplicaID: test.fields.ReadReplicaID, diff --git a/internal/k8s/client/client_test.go b/internal/k8s/client/client_test.go new file mode 100644 index 00000000000..1feec7b39fc --- /dev/null +++ b/internal/k8s/client/client_test.go @@ -0,0 +1,911 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package client + +// NOT IMPLEMENTED BELOW +// +// func TestNew(t *testing.T) { +// type args struct { +// opts []Option +// } +// type want struct { +// want Client +// err error +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, Client, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got Client, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// opts:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// opts:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// got, err := New(test.args.opts...) +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_client_Get(t *testing.T) { +// type args struct { +// ctx context.Context +// name string +// namespace string +// obj cli.Object +// opts []cli.GetOption +// } +// type fields struct { +// scheme *runtime.Scheme +// reader cli.Reader +// withWatch cli.WithWatch +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// name:"", +// namespace:"", +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// name:"", +// namespace:"", +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &client{ +// scheme: test.fields.scheme, +// reader: test.fields.reader, +// withWatch: test.fields.withWatch, +// } +// +// err := c.Get(test.args.ctx, test.args.name, test.args.namespace, test.args.obj, test.args.opts...) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_client_List(t *testing.T) { +// type args struct { +// ctx context.Context +// list cli.ObjectList +// opts []cli.ListOption +// } +// type fields struct { +// scheme *runtime.Scheme +// reader cli.Reader +// withWatch cli.WithWatch +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// list:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// list:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &client{ +// scheme: test.fields.scheme, +// reader: test.fields.reader, +// withWatch: test.fields.withWatch, +// } +// +// err := c.List(test.args.ctx, test.args.list, test.args.opts...) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_client_Create(t *testing.T) { +// type args struct { +// ctx context.Context +// obj Object +// opts []CreateOption +// } +// type fields struct { +// scheme *runtime.Scheme +// reader cli.Reader +// withWatch cli.WithWatch +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &client{ +// scheme: test.fields.scheme, +// reader: test.fields.reader, +// withWatch: test.fields.withWatch, +// } +// +// err := c.Create(test.args.ctx, test.args.obj, test.args.opts...) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_client_Delete(t *testing.T) { +// type args struct { +// ctx context.Context +// obj Object +// opts []cli.DeleteOption +// } +// type fields struct { +// scheme *runtime.Scheme +// reader cli.Reader +// withWatch cli.WithWatch +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &client{ +// scheme: test.fields.scheme, +// reader: test.fields.reader, +// withWatch: test.fields.withWatch, +// } +// +// err := c.Delete(test.args.ctx, test.args.obj, test.args.opts...) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_client_Update(t *testing.T) { +// type args struct { +// ctx context.Context +// obj Object +// opts []cli.UpdateOption +// } +// type fields struct { +// scheme *runtime.Scheme +// reader cli.Reader +// withWatch cli.WithWatch +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &client{ +// scheme: test.fields.scheme, +// reader: test.fields.reader, +// withWatch: test.fields.withWatch, +// } +// +// err := c.Update(test.args.ctx, test.args.obj, test.args.opts...) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_client_Watch(t *testing.T) { +// type args struct { +// ctx context.Context +// obj cli.ObjectList +// opts []ListOption +// } +// type fields struct { +// scheme *runtime.Scheme +// reader cli.Reader +// withWatch cli.WithWatch +// } +// type want struct { +// want watch.Interface +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, watch.Interface, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got watch.Interface, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// ctx:nil, +// obj:nil, +// opts:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &client{ +// scheme: test.fields.scheme, +// reader: test.fields.reader, +// withWatch: test.fields.withWatch, +// } +// +// got, err := c.Watch(test.args.ctx, test.args.obj, test.args.opts...) +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_client_LabelSelector(t *testing.T) { +// type args struct { +// key string +// op selection.Operator +// vals []string +// } +// type fields struct { +// scheme *runtime.Scheme +// reader cli.Reader +// withWatch cli.WithWatch +// } +// type want struct { +// want labels.Selector +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, labels.Selector, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got labels.Selector, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// key:"", +// op:nil, +// vals:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// key:"", +// op:nil, +// vals:nil, +// }, +// fields: fields { +// scheme:nil, +// reader:nil, +// withWatch:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &client{ +// scheme: test.fields.scheme, +// reader: test.fields.reader, +// withWatch: test.fields.withWatch, +// } +// +// got, err := c.LabelSelector(test.args.key, test.args.op, test.args.vals) +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/internal/k8s/client/option_test.go b/internal/k8s/client/option_test.go new file mode 100644 index 00000000000..bd009daa9cc --- /dev/null +++ b/internal/k8s/client/option_test.go @@ -0,0 +1,102 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package client + +// NOT IMPLEMENTED BELOW +// +// func TestWithSchemeBuilder(t *testing.T) { +// type args struct { +// sb scheme.Builder +// } +// type want struct { +// want Option +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, Option) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got Option) error { +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// sb:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// sb:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// got := WithSchemeBuilder(test.args.sb) +// if err := checkFunc(test.want, got); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/internal/net/grpc/client_test.go b/internal/net/grpc/client_test.go index a118cc29ded..d6a54e384dc 100644 --- a/internal/net/grpc/client_test.go +++ b/internal/net/grpc/client_test.go @@ -113,7 +113,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -167,7 +167,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -210,7 +210,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -301,7 +301,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -352,7 +352,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -396,7 +396,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -488,7 +488,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -540,7 +540,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -585,7 +585,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -677,7 +677,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -729,7 +729,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -774,7 +774,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -867,7 +867,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -920,7 +920,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -966,7 +966,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1057,7 +1057,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -1112,7 +1112,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1156,7 +1156,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1248,7 +1248,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -1304,7 +1304,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1349,7 +1349,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1443,7 +1443,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -1501,7 +1501,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1548,7 +1548,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1635,7 +1635,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -1681,7 +1681,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1721,7 +1721,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1808,7 +1808,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -1854,7 +1854,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1894,7 +1894,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -1981,7 +1981,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -2027,7 +2027,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2067,7 +2067,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2159,7 +2159,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -2215,7 +2215,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2260,7 +2260,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2351,7 +2351,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -2402,7 +2402,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2446,7 +2446,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2537,7 +2537,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -2588,7 +2588,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2632,7 +2632,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2719,7 +2719,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -2765,7 +2765,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2805,7 +2805,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2895,7 +2895,7 @@ package grpc // addrs map[string]struct{} // poolSize uint64 // clientCount uint64 -// conns grpcConns +// conns sync.Map[string, pool.Conn] // hcDur time.Duration // prDur time.Duration // dialer net.Dialer @@ -2945,7 +2945,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -2988,7 +2988,7 @@ package grpc // addrs:nil, // poolSize:0, // clientCount:0, -// conns:grpcConns{}, +// conns:nil, // hcDur:nil, // prDur:nil, // dialer:nil, @@ -3069,3 +3069,186 @@ package grpc // }) // } // } +// +// func Test_gRPCClient_rangeConns(t *testing.T) { +// type args struct { +// fn func(addr string, p pool.Conn) bool +// } +// type fields struct { +// addrs map[string]struct{} +// poolSize uint64 +// clientCount uint64 +// conns sync.Map[string, pool.Conn] +// hcDur time.Duration +// prDur time.Duration +// dialer net.Dialer +// enablePoolRebalance bool +// resolveDNS bool +// dopts []DialOption +// copts []CallOption +// roccd string +// eg errgroup.Group +// bo backoff.Backoff +// cb circuitbreaker.CircuitBreaker +// gbo gbackoff.Config +// mcd time.Duration +// group singleflight.Group[pool.Conn] +// crl sync.Map[string, bool] +// ech <-chan error +// monitorRunning atomic.Bool +// stopMonitor context.CancelFunc +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// fn:nil, +// }, +// fields: fields { +// addrs:nil, +// poolSize:0, +// clientCount:0, +// conns:nil, +// hcDur:nil, +// prDur:nil, +// dialer:nil, +// enablePoolRebalance:false, +// resolveDNS:false, +// dopts:nil, +// copts:nil, +// roccd:"", +// eg:nil, +// bo:nil, +// cb:nil, +// gbo:nil, +// mcd:nil, +// group:nil, +// crl:nil, +// ech:nil, +// monitorRunning:nil, +// stopMonitor:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// fn:nil, +// }, +// fields: fields { +// addrs:nil, +// poolSize:0, +// clientCount:0, +// conns:nil, +// hcDur:nil, +// prDur:nil, +// dialer:nil, +// enablePoolRebalance:false, +// resolveDNS:false, +// dopts:nil, +// copts:nil, +// roccd:"", +// eg:nil, +// bo:nil, +// cb:nil, +// gbo:nil, +// mcd:nil, +// group:nil, +// crl:nil, +// ech:nil, +// monitorRunning:nil, +// stopMonitor:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// g := &gRPCClient{ +// addrs: test.fields.addrs, +// poolSize: test.fields.poolSize, +// clientCount: test.fields.clientCount, +// conns: test.fields.conns, +// hcDur: test.fields.hcDur, +// prDur: test.fields.prDur, +// dialer: test.fields.dialer, +// enablePoolRebalance: test.fields.enablePoolRebalance, +// resolveDNS: test.fields.resolveDNS, +// dopts: test.fields.dopts, +// copts: test.fields.copts, +// roccd: test.fields.roccd, +// eg: test.fields.eg, +// bo: test.fields.bo, +// cb: test.fields.cb, +// gbo: test.fields.gbo, +// mcd: test.fields.mcd, +// group: test.fields.group, +// crl: test.fields.crl, +// ech: test.fields.ech, +// monitorRunning: test.fields.monitorRunning, +// stopMonitor: test.fields.stopMonitor, +// } +// +// err := g.rangeConns(test.args.fn) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/internal/net/grpc/proto/proto_test.go b/internal/net/grpc/proto/proto_test.go index 5a8bb5a863f..22d756572e3 100644 --- a/internal/net/grpc/proto/proto_test.go +++ b/internal/net/grpc/proto/proto_test.go @@ -339,3 +339,89 @@ func TestToMessageV1(t *testing.T) { } // NOT IMPLEMENTED BELOW +// +// func TestToMessageV2(t *testing.T) { +// type args struct { +// m MessageV1 +// } +// type want struct { +// want Message +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, Message) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got Message) error { +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// m:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// m:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// got := ToMessageV2(test.args.m) +// if err := checkFunc(test.want, got); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/internal/net/grpc/stream_test.go b/internal/net/grpc/stream_test.go index c65aebd935e..27438cbdde2 100644 --- a/internal/net/grpc/stream_test.go +++ b/internal/net/grpc/stream_test.go @@ -295,92 +295,3 @@ func TestBidirectionalStream(t *testing.T) { // }) // } // } -// -// func Test_removeDuplicates(t *testing.T) { -// type args struct { -// x S -// less func(left, right E) int -// } -// type want struct { -// want S -// } -// type test struct { -// name string -// args args -// want want -// checkFunc func(want, S) error -// beforeFunc func(*testing.T, args) -// afterFunc func(*testing.T, args) -// } -// defaultCheckFunc := func(w want, got S) error { -// if !reflect.DeepEqual(got, w.want) { -// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) -// } -// return nil -// } -// tests := []test{ -// // TODO test cases -// /* -// { -// name: "test_case_1", -// args: args { -// x:nil, -// less:nil, -// }, -// want: want{}, -// checkFunc: defaultCheckFunc, -// beforeFunc: func(t *testing.T, args args) { -// t.Helper() -// }, -// afterFunc: func(t *testing.T, args args) { -// t.Helper() -// }, -// }, -// */ -// -// // TODO test cases -// /* -// func() test { -// return test { -// name: "test_case_2", -// args: args { -// x:nil, -// less:nil, -// }, -// want: want{}, -// checkFunc: defaultCheckFunc, -// beforeFunc: func(t *testing.T, args args) { -// t.Helper() -// }, -// afterFunc: func(t *testing.T, args args) { -// t.Helper() -// }, -// } -// }(), -// */ -// } -// -// for _, tc := range tests { -// test := tc -// t.Run(test.name, func(tt *testing.T) { -// tt.Parallel() -// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) -// if test.beforeFunc != nil { -// test.beforeFunc(tt, test.args) -// } -// if test.afterFunc != nil { -// defer test.afterFunc(tt, test.args) -// } -// checkFunc := test.checkFunc -// if test.checkFunc == nil { -// checkFunc = defaultCheckFunc -// } -// -// got := removeDuplicates(test.args.x, test.args.less) -// if err := checkFunc(test.want, got); err != nil { -// tt.Errorf("error = %v", err) -// } -// -// }) -// } -// } diff --git a/internal/observability/metrics/index/job/correction/correction_test.go b/internal/observability/metrics/index/job/correction/correction_test.go new file mode 100644 index 00000000000..1b41d0b73cd --- /dev/null +++ b/internal/observability/metrics/index/job/correction/correction_test.go @@ -0,0 +1,294 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package correction + +// NOT IMPLEMENTED BELOW +// +// func TestNew(t *testing.T) { +// type args struct { +// c service.Corrector +// } +// type want struct { +// want metrics.Metric +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, metrics.Metric) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got metrics.Metric) error { +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// c:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// c:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// got := New(test.args.c) +// if err := checkFunc(test.want, got); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_correctionMetrics_View(t *testing.T) { +// type fields struct { +// correction service.Corrector +// } +// type want struct { +// want []*metrics.View +// err error +// } +// type test struct { +// name string +// fields fields +// want want +// checkFunc func(want, []*metrics.View, error) error +// beforeFunc func(*testing.T) +// afterFunc func(*testing.T) +// } +// defaultCheckFunc := func(w want, got []*metrics.View, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// fields: fields { +// correction:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// fields: fields { +// correction:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T,) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T,) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &correctionMetrics{ +// correction: test.fields.correction, +// } +// +// got, err := c.View() +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } +// +// func Test_correctionMetrics_Register(t *testing.T) { +// type args struct { +// m metrics.Meter +// } +// type fields struct { +// correction service.Corrector +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// m:nil, +// }, +// fields: fields { +// correction:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// m:nil, +// }, +// fields: fields { +// correction:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// c := &correctionMetrics{ +// correction: test.fields.correction, +// } +// +// err := c.Register(test.args.m) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/internal/observability/metrics/mem/malloc/malloc_test.go b/internal/observability/metrics/mem/malloc/malloc_test.go index 70adfed31da..c71e1540db0 100644 --- a/internal/observability/metrics/mem/malloc/malloc_test.go +++ b/internal/observability/metrics/mem/malloc/malloc_test.go @@ -1,3 +1,16 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package malloc // NOT IMPLEMENTED BELOW diff --git a/pkg/agent/core/ngt/handler/grpc/object_test.go b/pkg/agent/core/ngt/handler/grpc/object_test.go index 6626949efd1..233349c3b3d 100644 --- a/pkg/agent/core/ngt/handler/grpc/object_test.go +++ b/pkg/agent/core/ngt/handler/grpc/object_test.go @@ -1455,10 +1455,9 @@ func Test_server_GetTimestamp(t *testing.T) { // NOT IMPLEMENTED BELOW // -// func Test_server_StreamListObject(t *testing.T) { +// func Test_server_StreamGetObject(t *testing.T) { // type args struct { -// in0 *payload.Object_List_Request -// stream vald.Object_StreamListObjectServer +// stream vald.Object_StreamGetObjectServer // } // type fields struct { // name string @@ -1493,7 +1492,6 @@ func Test_server_GetTimestamp(t *testing.T) { // { // name: "test_case_1", // args: args { -// in0:nil, // stream:nil, // }, // fields: fields { @@ -1522,7 +1520,6 @@ func Test_server_GetTimestamp(t *testing.T) { // return test { // name: "test_case_2", // args: args { -// in0:nil, // stream:nil, // }, // fields: fields { @@ -1572,7 +1569,7 @@ func Test_server_GetTimestamp(t *testing.T) { // UnimplementedValdServer: test.fields.UnimplementedValdServer, // } // -// err := s.StreamListObject(test.args.in0, test.args.stream) +// err := s.StreamGetObject(test.args.stream) // if err := checkFunc(test.want, err); err != nil { // tt.Errorf("error = %v", err) // } diff --git a/pkg/gateway/lb/handler/grpc/handler_test.go b/pkg/gateway/lb/handler/grpc/handler_test.go index 928adb73e00..bb35ec7136c 100644 --- a/pkg/gateway/lb/handler/grpc/handler_test.go +++ b/pkg/gateway/lb/handler/grpc/handler_test.go @@ -3901,3 +3901,137 @@ package grpc // }) // } // } +// +// func Test_server_StreamListObject(t *testing.T) { +// type args struct { +// req *payload.Object_List_Request +// stream vald.Object_StreamListObjectServer +// } +// type fields struct { +// eg errgroup.Group +// gateway service.Gateway +// timeout time.Duration +// replica int +// streamConcurrency int +// multiConcurrency int +// name string +// ip string +// UnimplementedValdServer vald.UnimplementedValdServer +// } +// type want struct { +// err error +// } +// type test struct { +// name string +// args args +// fields fields +// want want +// checkFunc func(want, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// req:nil, +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// timeout:nil, +// replica:0, +// streamConcurrency:0, +// multiConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServer:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// req:nil, +// stream:nil, +// }, +// fields: fields { +// eg:nil, +// gateway:nil, +// timeout:nil, +// replica:0, +// streamConcurrency:0, +// multiConcurrency:0, +// name:"", +// ip:"", +// UnimplementedValdServer:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// s := &server{ +// eg: test.fields.eg, +// gateway: test.fields.gateway, +// timeout: test.fields.timeout, +// replica: test.fields.replica, +// streamConcurrency: test.fields.streamConcurrency, +// multiConcurrency: test.fields.multiConcurrency, +// name: test.fields.name, +// ip: test.fields.ip, +// UnimplementedValdServer: test.fields.UnimplementedValdServer, +// } +// +// err := s.StreamListObject(test.args.req, test.args.stream) +// if err := checkFunc(test.want, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/pkg/index/job/correction/service/corrector_test.go b/pkg/index/job/correction/service/corrector_test.go index a249d59f60b..eab80e6fab6 100644 --- a/pkg/index/job/correction/service/corrector_test.go +++ b/pkg/index/job/correction/service/corrector_test.go @@ -561,7 +561,7 @@ func Test_correct_correctReplica(t *testing.T) { // type fields struct { // discoverer discoverer.Client // agentAddrs []string -// indexInfos sync.Map[string, *payload.Info_Index_Count] +// sortedByIndexCntAddrs []string // uuidsCount uint32 // uncommittedUUIDsCount uint32 // checkedID bbolt.Bbolt @@ -605,7 +605,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -638,7 +638,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -680,7 +680,7 @@ func Test_correct_correctReplica(t *testing.T) { // c := &correct{ // discoverer: test.fields.discoverer, // agentAddrs: test.fields.agentAddrs, -// indexInfos: test.fields.indexInfos, +// sortedByIndexCntAddrs: test.fields.sortedByIndexCntAddrs, // uuidsCount: test.fields.uuidsCount, // uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount, // checkedID: test.fields.checkedID, @@ -708,7 +708,7 @@ func Test_correct_correctReplica(t *testing.T) { // type fields struct { // discoverer discoverer.Client // agentAddrs []string -// indexInfos sync.Map[string, *payload.Info_Index_Count] +// sortedByIndexCntAddrs []string // uuidsCount uint32 // uncommittedUUIDsCount uint32 // checkedID bbolt.Bbolt @@ -748,7 +748,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -781,7 +781,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -823,7 +823,7 @@ func Test_correct_correctReplica(t *testing.T) { // c := &correct{ // discoverer: test.fields.discoverer, // agentAddrs: test.fields.agentAddrs, -// indexInfos: test.fields.indexInfos, +// sortedByIndexCntAddrs: test.fields.sortedByIndexCntAddrs, // uuidsCount: test.fields.uuidsCount, // uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount, // checkedID: test.fields.checkedID, @@ -851,7 +851,7 @@ func Test_correct_correctReplica(t *testing.T) { // type fields struct { // discoverer discoverer.Client // agentAddrs []string -// indexInfos sync.Map[string, *payload.Info_Index_Count] +// sortedByIndexCntAddrs []string // uuidsCount uint32 // uncommittedUUIDsCount uint32 // checkedID bbolt.Bbolt @@ -891,7 +891,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -924,7 +924,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -966,7 +966,7 @@ func Test_correct_correctReplica(t *testing.T) { // c := &correct{ // discoverer: test.fields.discoverer, // agentAddrs: test.fields.agentAddrs, -// indexInfos: test.fields.indexInfos, +// sortedByIndexCntAddrs: test.fields.sortedByIndexCntAddrs, // uuidsCount: test.fields.uuidsCount, // uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount, // checkedID: test.fields.checkedID, @@ -991,7 +991,7 @@ func Test_correct_correctReplica(t *testing.T) { // type fields struct { // discoverer discoverer.Client // agentAddrs []string -// indexInfos sync.Map[string, *payload.Info_Index_Count] +// sortedByIndexCntAddrs []string // uuidsCount uint32 // uncommittedUUIDsCount uint32 // checkedID bbolt.Bbolt @@ -1027,7 +1027,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -1057,7 +1057,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -1099,7 +1099,7 @@ func Test_correct_correctReplica(t *testing.T) { // c := &correct{ // discoverer: test.fields.discoverer, // agentAddrs: test.fields.agentAddrs, -// indexInfos: test.fields.indexInfos, +// sortedByIndexCntAddrs: test.fields.sortedByIndexCntAddrs, // uuidsCount: test.fields.uuidsCount, // uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount, // checkedID: test.fields.checkedID, @@ -1124,7 +1124,7 @@ func Test_correct_correctReplica(t *testing.T) { // type fields struct { // discoverer discoverer.Client // agentAddrs []string -// indexInfos sync.Map[string, *payload.Info_Index_Count] +// sortedByIndexCntAddrs []string // uuidsCount uint32 // uncommittedUUIDsCount uint32 // checkedID bbolt.Bbolt @@ -1160,7 +1160,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -1190,7 +1190,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -1232,7 +1232,7 @@ func Test_correct_correctReplica(t *testing.T) { // c := &correct{ // discoverer: test.fields.discoverer, // agentAddrs: test.fields.agentAddrs, -// indexInfos: test.fields.indexInfos, +// sortedByIndexCntAddrs: test.fields.sortedByIndexCntAddrs, // uuidsCount: test.fields.uuidsCount, // uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount, // checkedID: test.fields.checkedID, @@ -1257,7 +1257,7 @@ func Test_correct_correctReplica(t *testing.T) { // type fields struct { // discoverer discoverer.Client // agentAddrs []string -// indexInfos sync.Map[string, *payload.Info_Index_Count] +// sortedByIndexCntAddrs []string // uuidsCount uint32 // uncommittedUUIDsCount uint32 // checkedID bbolt.Bbolt @@ -1293,7 +1293,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -1323,7 +1323,7 @@ func Test_correct_correctReplica(t *testing.T) { // fields: fields { // discoverer:nil, // agentAddrs:nil, -// indexInfos:nil, +// sortedByIndexCntAddrs:nil, // uuidsCount:0, // uncommittedUUIDsCount:0, // checkedID:nil, @@ -1365,7 +1365,7 @@ func Test_correct_correctReplica(t *testing.T) { // c := &correct{ // discoverer: test.fields.discoverer, // agentAddrs: test.fields.agentAddrs, -// indexInfos: test.fields.indexInfos, +// sortedByIndexCntAddrs: test.fields.sortedByIndexCntAddrs, // uuidsCount: test.fields.uuidsCount, // uncommittedUUIDsCount: test.fields.uncommittedUUIDsCount, // checkedID: test.fields.checkedID, diff --git a/pkg/index/job/correction/service/options_test.go b/pkg/index/job/correction/service/options_test.go index ed1a312363b..4c6bccc1e7d 100644 --- a/pkg/index/job/correction/service/options_test.go +++ b/pkg/index/job/correction/service/options_test.go @@ -273,7 +273,7 @@ package service // } // } // -// func TestWithBboltAsyncWriteConcurrency(t *testing.T) { +// func TestWithKvsAsyncWriteConcurrency(t *testing.T) { // type args struct { // num int // } @@ -350,7 +350,7 @@ package service // checkFunc = defaultCheckFunc // } // -// got := WithBboltAsyncWriteConcurrency(test.args.num) +// got := WithKvsAsyncWriteConcurrency(test.args.num) // if err := checkFunc(test.want, got); err != nil { // tt.Errorf("error = %v", err) // } diff --git a/pkg/index/job/readreplica/rotate/usecase/rotate_test.go b/pkg/index/job/readreplica/rotate/usecase/rotate_test.go new file mode 100644 index 00000000000..1eab852c2d9 --- /dev/null +++ b/pkg/index/job/readreplica/rotate/usecase/rotate_test.go @@ -0,0 +1,106 @@ +// Copyright (C) 2019-2023 vdaas.org vald team +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// You may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package usecase + +// NOT IMPLEMENTED BELOW +// +// func TestNew(t *testing.T) { +// type args struct { +// cfg *config.Data +// } +// type want struct { +// want runner.Runner +// err error +// } +// type test struct { +// name string +// args args +// want want +// checkFunc func(want, runner.Runner, error) error +// beforeFunc func(*testing.T, args) +// afterFunc func(*testing.T, args) +// } +// defaultCheckFunc := func(w want, got runner.Runner, err error) error { +// if !errors.Is(err, w.err) { +// return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) +// } +// if !reflect.DeepEqual(got, w.want) { +// return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) +// } +// return nil +// } +// tests := []test{ +// // TODO test cases +// /* +// { +// name: "test_case_1", +// args: args { +// cfg:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// }, +// */ +// +// // TODO test cases +// /* +// func() test { +// return test { +// name: "test_case_2", +// args: args { +// cfg:nil, +// }, +// want: want{}, +// checkFunc: defaultCheckFunc, +// beforeFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// afterFunc: func(t *testing.T, args args) { +// t.Helper() +// }, +// } +// }(), +// */ +// } +// +// for _, tc := range tests { +// test := tc +// t.Run(test.name, func(tt *testing.T) { +// tt.Parallel() +// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) +// if test.beforeFunc != nil { +// test.beforeFunc(tt, test.args) +// } +// if test.afterFunc != nil { +// defer test.afterFunc(tt, test.args) +// } +// checkFunc := test.checkFunc +// if test.checkFunc == nil { +// checkFunc = defaultCheckFunc +// } +// +// got, err := New(test.args.cfg) +// if err := checkFunc(test.want, got, err); err != nil { +// tt.Errorf("error = %v", err) +// } +// +// }) +// } +// } diff --git a/versions/GO_VERSION b/versions/GO_VERSION index 20a1265cf39..ce2dd53570b 100644 --- a/versions/GO_VERSION +++ b/versions/GO_VERSION @@ -1 +1 @@ -1.21.4 +1.21.5 diff --git a/versions/K3S_VERSION b/versions/K3S_VERSION index 4db534a69da..75e0967887b 100644 --- a/versions/K3S_VERSION +++ b/versions/K3S_VERSION @@ -1 +1 @@ -v1.28.4-rc1-k3s1 +v1.28.4-k3s1 diff --git a/versions/PROMETHEUS_STACK_VERSION b/versions/PROMETHEUS_STACK_VERSION index e3212defa29..b406fbef67e 100644 --- a/versions/PROMETHEUS_STACK_VERSION +++ b/versions/PROMETHEUS_STACK_VERSION @@ -1 +1 @@ -54.2.2 \ No newline at end of file +55.0.0 diff --git a/versions/YQ_VERSION b/versions/YQ_VERSION index 774c6084ecc..5bd5fbc12a3 100644 --- a/versions/YQ_VERSION +++ b/versions/YQ_VERSION @@ -1 +1 @@ -v4.40.3 +v4.40.4