Skip to content
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

Add a test to ensure that labels are updated as a part of TaskRun #2785

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

R2wenD2
Copy link
Contributor

@R2wenD2 R2wenD2 commented Jun 8, 2020

Changes

Add a test to validate that labels are updated during task run reconciliation. This addresses #2728

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 8, 2020
@tekton-robot
Copy link
Collaborator

This PR cannot be merged: expecting exactly one kind/ label

Available kind/ labels are:

kind/bug: Categorizes issue or PR as related to a bug.
kind/flake: Categorizes issue or PR as related to a flakey test
kind/cleanup: Categorizes issue or PR as related to cleaning up code, process, or technical debt.
kind/design: Categorizes issue or PR as related to design.
kind/documentation: Categorizes issue or PR as related to documentation.
kind/feature: Categorizes issue or PR as related to a new feature.
kind/misc: Categorizes issue or PR as a miscellaneuous one.

1 similar comment
@tekton-robot
Copy link
Collaborator

This PR cannot be merged: expecting exactly one kind/ label

Available kind/ labels are:

kind/bug: Categorizes issue or PR as related to a bug.
kind/flake: Categorizes issue or PR as related to a flakey test
kind/cleanup: Categorizes issue or PR as related to cleaning up code, process, or technical debt.
kind/design: Categorizes issue or PR as related to design.
kind/documentation: Categorizes issue or PR as related to documentation.
kind/feature: Categorizes issue or PR as related to a new feature.
kind/misc: Categorizes issue or PR as a miscellaneuous one.

@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jun 8, 2020

/kind cleanup

@tekton-robot tekton-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 8, 2020
@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jun 8, 2020

/assign @vdemeester

@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 9, 2020
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for updating. Please squash the commits prior to merge. Otherwise this looks ready to go!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbwsg

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2020
@wlynch
Copy link
Member

wlynch commented Jun 11, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2020
@wlynch
Copy link
Member

wlynch commented Jun 11, 2020

/lgtm cancel

Just reread scott's comments - (we should squash first)

@wlynch
Copy link
Member

wlynch commented Jun 11, 2020

/lgtm cancel

@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2020
@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jun 11, 2020

Awesome, thanks for updating. Please squash the commits prior to merge. Otherwise this looks ready to go!

Squashed!

@dibyom
Copy link
Member

dibyom commented Jun 12, 2020

/test tekton-pipeline-unit-tests

@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jun 12, 2020

/retest

1 similar comment
@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jun 12, 2020

/retest

@R2wenD2 R2wenD2 force-pushed the labels branch 2 times, most recently from 03b8155 to 00e3369 Compare June 12, 2020 17:16
@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jun 12, 2020

/retest

1 similar comment
@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jun 17, 2020

/retest

@vdemeester
Copy link
Member

=== RUN   TestReconcilePodUpdateStatus
2020-06-17T23:09:38.873Z	ERROR	TestReconcilePodUpdateStatus	taskrun/controller.go:58	Failed to create taskrun metrics recorder running_taskruns_count: cannot register view "running_taskruns_count"; a different view with the same name is already registered
taskruns_pod_latency: cannot register view "taskruns_pod_latency"; a different view with the same name is already registered
github.com/tektoncd/pipeline/pkg/reconciler/taskrun.NewController.func1
	/home/prow/go/src/github.com/tektoncd/pipeline/pkg/reconciler/taskrun/controller.go:58
github.com/tektoncd/pipeline/pkg/reconciler/taskrun.getTaskRunController
	/home/prow/go/src/github.com/tektoncd/pipeline/pkg/reconciler/taskrun/taskrun_test.go:302
github.com/tektoncd/pipeline/pkg/reconciler/taskrun.TestReconcilePodUpdateStatus
	/home/prow/go/src/github.com/tektoncd/pipeline/pkg/reconciler/taskrun/taskrun_test.go:1602
testing.tRunner
	/usr/local/go/src/testing/testing.go:992
2020-06-17T23:09:38.874Z	INFO	TestReconcilePodUpdateStatus	taskrun/controller.go:94	Setting up event handlers
2020-06-17T23:09:38.877Z	INFO	TestReconcilePodUpdateStatus.config-store	configmap/store.go:157	defaults/features config "config-defaults" config was added or updated: &config.Defaults{DefaultTimeoutMinutes:60, DefaultServiceAccount:"", DefaultManagedByLabelValue:"tekton-pipelines", DefaultPodTemplate:(*pod.Template)(nil)}
2020-06-17T23:09:38.877Z	INFO	TestReconcilePodUpdateStatus.config-store	configmap/store.go:157	defaults/features config "feature-flags" config was added or updated: &config.FeatureFlags{DisableHomeEnvOverwrite:false, DisableWorkingDirOverwrite:false, DisableAffinityAssistant:false, RunningInEnvWithInjectedSidecars:true}
{"level":"info","ts":1592435378.9759812,"logger":"fallback","caller":"taskrun/taskrun.go:302","msg":"Cloud Events: []"}
2020-06-17T23:09:38.976Z	DEBUG	TestReconcilePodUpdateStatus	controller/controller.go:340	Adding to queue foo/test-taskrun-run-success (depth: 1)
{"level":"info","ts":1592435378.9768696,"logger":"fallback","caller":"taskrun/taskrun.go:392","msg":"Successfully reconciled taskrun test-taskrun-run-success/foo with status: &apis.Condition{Type:\"Succeeded\", Status:\"Unknown\", Severity:\"\", LastTransitionTime:apis.VolatileTime{Inner:v1.Time{Time:time.Time{wall:0xbfb2c68cba37a424, ext:12440617989, loc:(*time.Location)(0x3f88f40)}}}, Reason:\"Running\", Message:\"Not all Steps in the Task have finished executing\"}"}
    TestReconcilePodUpdateStatus: taskrun_test.go:1625: Labels were not added to task run
    TestReconcilePodUpdateStatus: taskrun_test.go:1628: Did not get expected label (-want, +got):   string(
        - 	"test-task",
        + 	"",
          )
{"level":"info","ts":1592435378.979722,"logger":"fallback","caller":"taskrun/taskrun.go:302","msg":"Cloud Events: []"}
{"level":"info","ts":1592435378.9801276,"logger":"fallback","caller":"taskrun/taskrun.go:392","msg":"Successfully reconciled taskrun test-taskrun-run-success/foo with status: &apis.Condition{Type:\"Succeeded\", Status:\"True\", Severity:\"\", LastTransitionTime:apis.VolatileTime{Inner:v1.Time{Time:time.Time{wall:0xbfb2c68cba6a5556, ext:12443940147, loc:(*time.Location)(0x3f88f40)}}}, Reason:\"Succeeded\", Message:\"All Steps have completed executing\"}"}
--- FAIL: TestReconcilePodUpdateStatus (1.11s)

Seems like the test failure is legit

@vdemeester
Copy link
Member

@R2wenD2 ping 🙃

@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jul 6, 2020

@vdemeester I updated the issue, the failure is legit because our test framework doesn't work with patch. @mattmoor said he would back-out the change that made this start using patch instead of update, so I'm waiting on that.

@R2wenD2
Copy link
Contributor Author

R2wenD2 commented Jul 7, 2020

/retest

@vdemeester
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2020
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2020
@ghost
Copy link

ghost commented Jul 7, 2020

/lgtm

@tekton-robot tekton-robot assigned ghost Jul 7, 2020
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 7, 2020
@tekton-robot tekton-robot merged commit b117cd7 into tektoncd:master Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants