diff options
| author | Julie Qiu <julie@golang.org> | 2020-12-14 11:33:51 -0500 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2020-12-14 16:50:45 +0000 |
| commit | bd852dc5f13bca63f031a69b7482a3a7c6729698 (patch) | |
| tree | b21acab2daba8299469a0b48d09ef7f8c15c4dc0 /internal/testing/sample/sample.go | |
| parent | 4e306af91274b1f7cd0d186347da1d7bbf941edb (diff) | |
| download | go-x-pkgsite-bd852dc5f13bca63f031a69b7482a3a7c6729698.tar.xz | |
internal/frontend: fix commitTime for tests
CL 268638 added `.In(time.UTC)` to the commitTime for several tests.
This was causing tests to fail when run locally, due to different
outputs of absoluteTime.
absoluteTime for these commit times are now computed within the tests.
sample.UnitMeta also now sets the CommitTime to NowTruncated().
Change-Id: I3187c9a5eacd5d136c73080b2803241cb2022729
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/271808
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/testing/sample/sample.go')
| -rw-r--r-- | internal/testing/sample/sample.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/testing/sample/sample.go b/internal/testing/sample/sample.go index 1a0f3ca2..d39eb608 100644 --- a/internal/testing/sample/sample.go +++ b/internal/testing/sample/sample.go @@ -243,6 +243,7 @@ func UnitMeta(path, modulePath, version, name string, isRedistributable bool) *i Version: version, Path: path, Name: name, + CommitTime: NowTruncated(), IsRedistributable: isRedistributable, Licenses: LicenseMetadata, SourceInfo: source.NewGitHubInfo("https://"+modulePath, "", version), |
