feat(report): GitHub Dependency Snapshots support (#1522)

Co-authored-by: Shira Cohen <97398476+ShiraCohen33@users.noreply.github.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
AndreyLevchenko
2022-05-27 00:34:15 +06:00
committed by GitHub
parent b7ec642572
commit 4ab696eaa2
15 changed files with 565 additions and 28 deletions

23
pkg/clock/clock.go Normal file
View File

@@ -0,0 +1,23 @@
package clock
import (
"testing"
"time"
"k8s.io/utils/clock"
clocktesting "k8s.io/utils/clock/testing"
)
var c clock.Clock = clock.RealClock{}
// SetFakeTime sets a fake time for testing.
func SetFakeTime(t *testing.T, fakeTime time.Time) {
c = clocktesting.NewFakeClock(fakeTime)
t.Cleanup(func() {
c = clock.RealClock{}
})
}
func Now() time.Time {
return c.Now()
}