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

Cleanup cluster resources when test fails #503

Merged
merged 1 commit into from
Mar 30, 2020
Merged

Conversation

dibyom
Copy link
Member

@dibyom dibyom commented Mar 26, 2020

Fixes #495

Signed-off-by: Dibyo Mukherjee [email protected]

Changes

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.

Release Notes

@tekton-robot tekton-robot requested review from dlorenc and wlynch March 26, 2020 02:37
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 26, 2020
@ncskier
Copy link
Member

ncskier commented Mar 26, 2020

I tested this out (using Docker for Desktop) and it didn't seem to clean up the cluster-wide resources when I interrupted the test with Ctrl+C or when I added a t.Fatal()to make the test fail 😕I'm not sure why though... did it work for you when you tested this @dibyom ?

Also, looks like the build test is failing because of gosimple:

I0326 02:58:02.072] pkg/apis/triggers/v1alpha1/event_listener_validation.go:65:31: S1039: unnecessary use of fmt.Sprintf (gosimple)
I0326 02:58:02.072] return apis.ErrMissingField(fmt.Sprintf("template.name"))

@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 26, 2020
@ncskier
Copy link
Member

ncskier commented Mar 27, 2020

Hm, I just tested again, and the cleanup worked when I put a t.Fatal() in the test. However, the cleanup still doesn't seem to work when I interrupt the test with Ctrl+C.

@dibyom
Copy link
Member Author

dibyom commented Mar 27, 2020

The cleanup should work Ctrl + C as well due to
knativetest.CleanupOnInterrupt(func() { cleanup(t, c, namespace) }, t.Logf)

Just tried this out on my local environment (linux machines, cluster is GKE) and the test cleaned up fine
`

@ncskier
Copy link
Member

ncskier commented Mar 30, 2020

Ok. Yeah, not sure why the Ctrl+C isn't working for me, but at least it cleans up when the test fails. So, this PR definitely addresses the issue 👍
/lgtm
/approve

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2020
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncskier

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 Mar 30, 2020
@ncskier
Copy link
Member

ncskier commented Mar 30, 2020

/test pull-tekton-triggers-build-tests

@tekton-robot tekton-robot merged commit d4ce62f into tektoncd:master Mar 30, 2020
@dibyom dibyom deleted the 495 branch March 30, 2020 18:10
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. cla: yes lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup cluster resources when e2e tests fail
4 participants