You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of issue view tests doesn't mock the current time and makes test fail after 2021-01-23.
Steps to reproduce the behavior
Clone cli/cli
Type go test ./pkg/cmd/issue/view
See
FAIL: TestIssueView_tty_Preview (0.00s)
--- FAIL: TestIssueView_tty_Preview/Open_issue_with_empty_body (0.00s)
view_test.go:267: output did not match regexp /Open.*marseilles opened about 9 years ago.*9 comments/
> output
ix of coins
Open • marseilles opened about 10 years ago • 9 comments
Labels: tarot
These tests started to fail 2 days ago because the dates in the test fixtures point to 2011-01-26
@cristiand391 Thank you for the report and for the proposed fix!
We used to take the overridable func approach in the past, but recently we avoid that approach since it doesn't lend itself well to parallel tests. We don't execute our tests in parallel yet, but we might want to do so in the future. I've opened a PR with an approach that freezes the current time per command run.
Describe the bug
The current implementation of
issue view
tests doesn't mock the current time and makes test fail after2021-01-23
.Steps to reproduce the behavior
cli/cli
go test ./pkg/cmd/issue/view
These tests started to fail 2 days ago because the dates in the test fixtures point to
2011-01-26
cli/pkg/cmd/issue/view/fixtures/issueView_previewWithMetadata.json
Line 10 in 6e2c1b3
cli/pkg/cmd/issue/view/view.go
Lines 142 to 145 in 6e2c1b3
output:
Open • marseilles opened about 10 years ago • 9 comments
instead of:
Open • marseilles opened about 9 years ago • 9 comments
.See: https://github.com/cli/cli/pull/2839/checks?check_run_id=1758707814#step:5:55
The text was updated successfully, but these errors were encountered: