Skip to content

Convert gc_e2e_test.go to ginkgo #1429

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

Merged
merged 1 commit into from
May 12, 2020

Conversation

harishsurf
Copy link
Contributor

Description of the change:
This change converts gc_e2e_test.go to leverage ginkgo's BDD approach

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 6, 2020

//By("check for dependent (should be deleted since last blocking owner was deleted", func() {
// check for dependent (should be deleted since last blocking owner was deleted)
cf, err := kubeClient.KubernetesInterface().CoreV1().ConfigMaps(testNamespace).Get(dependent.GetName(), metav1.GetOptions{})
Copy link
Contributor Author

@harishsurf harishsurf Apr 6, 2020

Choose a reason for hiding this comment

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

The test ensures that the dependent configMap is not deleted if one of its owner reference is deleted.

Problem: The assertion at line 266 fails because err is nil

What I found:
When ownerB CSV is deleted, an empty configMap struct is returned in the older version. (line 262)
See below output:
Current version:

###B &ConfigMap{ObjectMeta:{dependent  openshift-operators /api/v1/namespaces/openshift-operators/configmaps/dependent 412d8073-d3ce-4d11-9a77-7876f0e8e062 161740 0 2020-04-06 18:25:30 -0400 EDT <nil> <nil> map[] map[] [

Older version:

###B &ConfigMap{ObjectMeta:{      0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] []  []},Data:map[string]string{},BinaryData:map[string][]byte{},}cleaning up any remaining non persistent resources...

The cf returned here has value whereas in the older version of the file, cf returns an empty ConfigMap struct as seen above

Because of this, at line 266
Current version:

 Error is <nil> and value is <nil>

vs
Older version:

 Error type *errors.StatusError and value is configmaps "dependent" not found

Copy link
Member

@Bowenislandsong Bowenislandsong Apr 7, 2020

Choose a reason for hiding this comment

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

I wonder if that has anything to do with your foreground deletion option. Since the object in the configmap returned is the dependent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Figured out the issue. It was related to the placement of the deletion code inside of It block. Thanks for looking into this!

@harishsurf harishsurf force-pushed the e2e-gc branch 2 times, most recently from fbee673 to 182efde Compare April 7, 2020 14:30

When("removing one of the owner", func() {

It("deleting ownerA CSV in the foreground", func() {
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
It("deleting ownerA CSV in the foreground", func() {
It("deletes ownerA CSV in the foreground", func() {

Expect(err).NotTo(HaveOccurred(), "dependent could not be created")
})

Context("owner reference behavior can be verified", func() {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this describe the context more? something about the foreground propogation policy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added it :)

// CSV-A CSV-B CSV-B
// \ / --Delete CSV-A--> |
// ConfigMap ConfigMap
Describe("Multiple OwnerReferences will not be garbage collected", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Describe("Multiple OwnerReferences will not be garbage collected", func() {
Describe("Resources with Multiple OwnerReferences", func() {

@harishsurf
Copy link
Contributor Author

/retest

@harishsurf harishsurf changed the title WIP: Convert gc_e2e_test.go to ginkgo Convert gc_e2e_test.go to ginkgo Apr 13, 2020
@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Apr 13, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2020
@harishsurf harishsurf force-pushed the e2e-gc branch 2 times, most recently from 17aa209 to 1afae36 Compare April 21, 2020 13:07
@harishsurf
Copy link
Contributor Author

/retest

@harishsurf
Copy link
Contributor Author

/retest

2 similar comments
@harishsurf
Copy link
Contributor Author

/retest

@harishsurf
Copy link
Contributor Author

/retest

@exdx
Copy link
Member

exdx commented May 6, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2020
@exdx
Copy link
Member

exdx commented May 6, 2020

/retest

Copy link
Member

@awgreene awgreene left a comment

Choose a reason for hiding this comment

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

No blocking nits - feel free to update the PR as you see fit.

@awgreene
Copy link
Member

awgreene commented May 7, 2020

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2020
@shawn-hurley
Copy link
Member

Adding a valid bug because making CI tests more reliable.

@shawn-hurley shawn-hurley added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 8, 2020
@harishsurf
Copy link
Contributor Author

/test e2e-gcp

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@shawn-hurley
Copy link
Member

/hold

I am worried that we are adding flakes to CI

the test failures appear to be related to this change can someone look?

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 8, 2020
@harishsurf
Copy link
Contributor Author

/hold

I am worried that we are adding flakes to CI

the test failures appear to be related to this change can someone look?

@shawn-hurley, I ran some analysis(with Ben's help) on our ci-failures using prow's history. Could you take a look at this gist and see if it has enough evidence to have this and other ginkgo PRs merged?
cc @benluddy @ecordell

@shawn-hurley
Copy link
Member

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 11, 2020
@shawn-hurley
Copy link
Member

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

15 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit d23b7ab into operator-framework:master May 12, 2020
@harishsurf harishsurf deleted the e2e-gc branch May 19, 2020 14:38
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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.