-
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.
Merge pull request #73446 from Azhng/backport21.2-72556-72692-73363
release-21.2: improve statusccl package unit test
- Loading branch information
Showing
8 changed files
with
371 additions
and
250 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "statusccl", | ||
srcs = ["tenant_test_utils.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/serverccl/statusccl", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/base", | ||
"//pkg/roachpb:with-mocks", | ||
"//pkg/security", | ||
"//pkg/server/serverpb", | ||
"//pkg/sql/pgwire", | ||
"//pkg/sql/sqlstats/persistedsqlstats", | ||
"//pkg/sql/tests", | ||
"//pkg/testutils/serverutils", | ||
"//pkg/testutils/sqlutils", | ||
"//pkg/util/httputil", | ||
"//pkg/util/log", | ||
"//pkg/util/protoutil", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "statusccl_test", | ||
srcs = [ | ||
"main_test.go", | ||
"tenant_grpc_test.go", | ||
"tenant_status_test.go", | ||
], | ||
embed = [":statusccl"], | ||
deps = [ | ||
"//pkg/base", | ||
"//pkg/ccl", | ||
"//pkg/ccl/kvccl", | ||
"//pkg/ccl/utilccl", | ||
"//pkg/roachpb:with-mocks", | ||
"//pkg/rpc", | ||
"//pkg/security", | ||
"//pkg/security/securitytest", | ||
"//pkg/server", | ||
"//pkg/server/serverpb", | ||
"//pkg/sql/catalog/catconstants", | ||
"//pkg/sql/catalog/descpb", | ||
"//pkg/sql/idxusage", | ||
"//pkg/sql/sqlstats", | ||
"//pkg/sql/tests", | ||
"//pkg/testutils/serverutils", | ||
"//pkg/testutils/skip", | ||
"//pkg/testutils/sqlutils", | ||
"//pkg/testutils/testcluster", | ||
"//pkg/util/leaktest", | ||
"//pkg/util/log", | ||
"//pkg/util/randutil", | ||
"//pkg/util/timeutil", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Licensed as a CockroachDB Enterprise file under the Cockroach Community | ||
// License (the "License"); you may not use this file except in compliance with | ||
// the License. You may obtain a copy of the License at | ||
// | ||
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt | ||
|
||
package statusccl | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
_ "github.com/cockroachdb/cockroach/pkg/ccl" | ||
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl" | ||
"github.com/cockroachdb/cockroach/pkg/security" | ||
"github.com/cockroachdb/cockroach/pkg/security/securitytest" | ||
"github.com/cockroachdb/cockroach/pkg/server" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster" | ||
"github.com/cockroachdb/cockroach/pkg/util/randutil" | ||
) | ||
|
||
func TestMain(m *testing.M) { | ||
defer utilccl.TestingEnableEnterprise()() | ||
security.SetAssetLoader(securitytest.EmbeddedAssets) | ||
randutil.SeedForTests() | ||
serverutils.InitTestServerFactory(server.TestServerFactory) | ||
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory) | ||
os.Exit(m.Run()) | ||
} | ||
|
||
//go:generate ../../../util/leaktest/add-leaktest.sh *_test.go |
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.