From 86e71f026eaadcae58d37354f42dea6b19ed4957 Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Mon, 7 Nov 2022 10:15:21 +0800 Subject: [PATCH] test: update the definition of testRunner and clusterTestCases Signed-off-by: Benjamin Wang --- tests/common/main_test.go | 8 +++++--- tests/common/unit_test.go | 5 +++++ tests/framework/integration/integration.go | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/common/main_test.go b/tests/common/main_test.go index 1bce798a4..be5e5a17d 100644 --- a/tests/common/main_test.go +++ b/tests/common/main_test.go @@ -15,14 +15,16 @@ package common import ( - "go.etcd.io/etcd/tests/v3/framework" "testing" "go.etcd.io/etcd/tests/v3/framework/config" + intf "go.etcd.io/etcd/tests/v3/framework/interfaces" ) -var testRunner = framework.UnitTestRunner -var clusterTestCases = func() []testCase { return nil } +var ( + testRunner intf.TestRunner + clusterTestCases func() []testCase +) func TestMain(m *testing.M) { testRunner.TestMain(m) diff --git a/tests/common/unit_test.go b/tests/common/unit_test.go index d88b15594..bb9e66446 100644 --- a/tests/common/unit_test.go +++ b/tests/common/unit_test.go @@ -23,6 +23,11 @@ import ( func init() { testRunner = framework.UnitTestRunner + clusterTestCases = unitClusterTestCases +} + +func unitClusterTestCases() []testCase { + return nil } // When a build tag (e.g. e2e or integration) isn't configured in IDE, diff --git a/tests/framework/integration/integration.go b/tests/framework/integration/integration.go index 1f07ff2b4..df9db28b8 100644 --- a/tests/framework/integration/integration.go +++ b/tests/framework/integration/integration.go @@ -50,7 +50,6 @@ func (e integrationRunner) BeforeTest(t testing.TB) { func (e integrationRunner) NewCluster(ctx context.Context, t testing.TB, opts ...config.ClusterOption) intf.Cluster { var err error cfg := config.NewClusterConfig(opts...) - integrationCfg := ClusterConfig{ Size: cfg.ClusterSize, QuotaBackendBytes: cfg.QuotaBackendBytes,