mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
pkg/util/coverage: update fakeTestDeps impl
testing.testDeps has had more methods added so fakeTestDeps needs to follow suit
This commit is contained in:
parent
a0bd6dd1e0
commit
cb98449156
@ -18,6 +18,8 @@ package coverage
|
||||
|
||||
import (
|
||||
"io"
|
||||
"reflect"
|
||||
"time"
|
||||
)
|
||||
|
||||
// This is an implementation of testing.testDeps. It doesn't need to do anything, because
|
||||
@ -27,6 +29,18 @@ import (
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
type fakeTestDeps struct{}
|
||||
|
||||
// https://go.dev/src/testing/fuzz.go#L88
|
||||
//
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
type corpusEntry = struct {
|
||||
Parent string
|
||||
Path string
|
||||
Data []byte
|
||||
Values []any
|
||||
Generation int
|
||||
IsSeed bool
|
||||
}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) ImportPath() string {
|
||||
return ""
|
||||
@ -37,6 +51,9 @@ func (fakeTestDeps) MatchString(pat, str string) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) SetPanicOnExit0(bool) {}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) StartCPUProfile(io.Writer) error {
|
||||
return nil
|
||||
@ -62,3 +79,29 @@ func (fakeTestDeps) WriteHeapProfile(io.Writer) error {
|
||||
func (fakeTestDeps) WriteProfileTo(string, io.Writer, int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) CoordinateFuzzing(time.Duration, int64, time.Duration, int64, int, []corpusEntry, []reflect.Type, string, string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) RunFuzzWorker(func(corpusEntry) error) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) ReadCorpus(string, []reflect.Type) ([]corpusEntry, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) CheckCorpus([]any, []reflect.Type) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) ResetCoverage() {}
|
||||
|
||||
//nolint:unused // U1000 see comment above, we know it's unused normally.
|
||||
func (fakeTestDeps) SnapshotCoverage() {}
|
||||
|
Loading…
Reference in New Issue
Block a user