-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide testing implementation of time.Now() #4487
Conversation
9ed30cd
to
9250fde
Compare
/test pull-tekton-pipeline-alpha-integration-tests |
/test tekton-pipeline-unit-tests |
may also address #2992 |
Prior to this commit, the TaskRun and PipelineRun reconciler tests implicitly depended on the value of time.Now. This commit allows tests to use a specific time as Now when reconciling TaskRuns and PipelineRuns. No functional changes.
/test pull-tekton-pipeline-alpha-integration-tests |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
@@ -24,6 +24,7 @@ import ( | |||
|
|||
"github.com/tektoncd/pipeline/pkg/apis/pipeline" | |||
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" | |||
"github.com/tektoncd/pipeline/pkg/clock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vdemeester @lbernick We used to have our own system.Clock
in knative.dev/pkg for exactly this reason and we moved to k8s.io/apimachinery/pkg/util/clock
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this could be a drop-in replacement here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
Changes
Prior to this commit, the TaskRun and PipelineRun reconciler tests implicitly depended on the value of time.Now.
This commit allows tests to use a specific time as Now when reconciling TaskRuns and PipelineRuns.
No functional changes.
/kind cleanup
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes