Move test specific option setting to the test file

Setting of "metricsRecorder" is only needed for testcase.

Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
Dave Chen 2021-02-22 16:38:13 +08:00
parent 0df8c69731
commit 20cad3b5da
2 changed files with 7 additions and 7 deletions

View File

@ -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) {

View File

@ -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)