Merge pull request #99297 from chendave/testonly

Move test specific option setting to the test file
This commit is contained in:
Kubernetes Prow Robot 2021-03-09 06:35:00 -08:00 committed by GitHub
commit 7c57489f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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. // WithPodNominator sets podNominator for the scheduling frameworkImpl.
func WithPodNominator(nominator framework.PodNominator) Option { func WithPodNominator(nominator framework.PodNominator) Option {
return func(o *frameworkOptions) { 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) { func TestRecordingMetrics(t *testing.T) {
state := &framework.CycleState{} state := &framework.CycleState{}
state.SetRecordPluginMetrics(true) state.SetRecordPluginMetrics(true)