-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
72098: roachtest: fix up `mockgen` usage w/ Bazel r=irfansharif a=rickystewart We were pointing to the checked-in generated files in the Bazel build here; instead, use `gomock`. Also clean up the `EXISTING_GO_GENERATE_COMMENTS` in `build/bazelutil/check.sh`. Release note: None 72237: kvserver: remove detritus for old change replicas and preemptive snaps r=nvanbenschoten a=tbg See individual commits. - kvserver: remove deprecated fields in ChangeReplicasTrigger - kvserver: improve comment on raft send buffer size - kvserver: improve comment on split trigger helper - kvserver: remove TODO for removing DisableEagerReplicaRemoval - kvserver: remove snapshot CanDecline flag - kvserver: reflect absence of preemptive snaps in more comments - kvserver: remove IsPreemptive() - kvserver: bump snapshotReservationWaitWarnThreshold - kvserver: add TODO about removing snapshot log sending code. - kvserver: assert that local descriptor "always" contains the replica - kvserver: remove env-defaults for snapshot rate limits Release note: None 72246: ci: make sure `check generated files` output is dumped if check fails r=rail a=rickystewart Closes #72245. Release note: None Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: Tobias Grieger <[email protected]>
- Loading branch information
Showing
37 changed files
with
641 additions
and
1,066 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,44 @@ | ||
load("@bazel_gomock//:gomock.bzl", "gomock") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "prometheus", | ||
srcs = [ | ||
"mock_generated.go", | ||
"prometheus.go", | ||
], | ||
name = "with-mocks", | ||
srcs = [":prometheus_mocks"], | ||
embed = [":prometheus"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/prometheus", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@com_github_golang_mock//gomock", | ||
], | ||
) | ||
|
||
go_library( | ||
name = "prometheus", | ||
srcs = ["prometheus.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/prometheus", | ||
visibility = ["//visibility:private"], | ||
deps = [ | ||
"//pkg/cmd/roachtest/logger", | ||
"//pkg/cmd/roachtest/option", | ||
"@com_github_golang_mock//gomock", | ||
"@in_gopkg_yaml_v2//:yaml_v2", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "prometheus_test", | ||
srcs = ["prometheus_test.go"], | ||
embed = [":prometheus"], | ||
embed = [":with-mocks"], # keep | ||
deps = [ | ||
"//pkg/cmd/roachtest/option", | ||
"@com_github_golang_mock//gomock", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) | ||
|
||
gomock( | ||
name = "prometheus_mocks", | ||
out = "mock_generated.go", | ||
interfaces = ["Cluster"], | ||
library = ":prometheus", | ||
package = "prometheus", | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.