From 20cad3b5dab28ccd16f8c06050c6a32e9d12c10b Mon Sep 17 00:00:00 2001 From: Dave Chen Date: Mon, 22 Feb 2021 16:38:13 +0800 Subject: [PATCH] Move test specific option setting to the test file Setting of "metricsRecorder" is only needed for testcase. Signed-off-by: Dave Chen --- pkg/scheduler/framework/runtime/framework.go | 7 ------- pkg/scheduler/framework/runtime/framework_test.go | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/scheduler/framework/runtime/framework.go b/pkg/scheduler/framework/runtime/framework.go index a6305e07d03..fea07023af0 100644 --- a/pkg/scheduler/framework/runtime/framework.go +++ b/pkg/scheduler/framework/runtime/framework.go @@ -190,13 +190,6 @@ func WithRunAllFilters(runAllFilters bool) Option { } } -// withMetricsRecorder is only used in tests. -func withMetricsRecorder(recorder *metricsRecorder) Option { - return func(o *frameworkOptions) { - o.metricsRecorder = recorder - } -} - // WithPodNominator sets podNominator for the scheduling frameworkImpl. func WithPodNominator(nominator framework.PodNominator) Option { return func(o *frameworkOptions) { diff --git a/pkg/scheduler/framework/runtime/framework_test.go b/pkg/scheduler/framework/runtime/framework_test.go index a6982b035f0..b8edc68c94f 100644 --- a/pkg/scheduler/framework/runtime/framework_test.go +++ b/pkg/scheduler/framework/runtime/framework_test.go @@ -1933,6 +1933,13 @@ func TestPermitPlugins(t *testing.T) { } } +// withMetricsRecorder set metricsRecorder for the scheduling frameworkImpl. +func withMetricsRecorder(recorder *metricsRecorder) Option { + return func(o *frameworkOptions) { + o.metricsRecorder = recorder + } +} + func TestRecordingMetrics(t *testing.T) { state := &framework.CycleState{} state.SetRecordPluginMetrics(true)