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

Revise delete tests #3822

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

benjaminjb
Copy link
Contributor

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • New feature
  • Bug fix
  • Documentation
  • Testing enhancement
  • Other

What is the current behavior (link to any open issues here)?

What is the new behavior (if this is a feature change)?

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Use files for legibility
  • Add describe/log collectors to every assert

Other Information:

* Use files for legibility
* Add describe/log collectors to every assert
@benjaminjb
Copy link
Contributor Author

Actually, this is low priority

Copy link
Collaborator

@jmckulk jmckulk left a comment

Choose a reason for hiding this comment

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

lgtm

apiVersion: kuttl.dev/v1beta1
kind: TestStep
apply:
- files/00-create-namespace.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see a files/00-create-namespace.yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

copy-paste error

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe this test could be in a different directory?

testing/kuttl/e2e
  delete/
    00-create...
  delete-<descriptive-suffix>/
    10-create...

also maybe not, having each delete type in a directory makes sense too.

A better name on 10-* would be appreciated. To see that it is deleting a replica cluster without having to click into the create-cluster.yaml file or the readme

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better names, check

Copy link
Collaborator

Choose a reason for hiding this comment

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

same for this file name


* Start a regular cluster with 2 replicas
* Delete it
* Check that nothing remains

#### Delete a cluster that never started
#### Delete a cluster that never started (20-21)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to check this? Kube should cleanup the resources regardless of the cluster status

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, I think this test was to check that we didn't have a finalizer on the cluster that made it impossible to delete while not running.

Copy link
Collaborator

Choose a reason for hiding this comment

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

would it make sense to put this in a TestStep - to be consistent with the delete-namespace test/other tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the docs, the delete happens at the beginning of the step, so I think a delete/errors teststep might work. Eh, I avoided it in case that wasn't the case, but I'll try it

Copy link
Contributor

@tjmoore4 tjmoore4 left a comment

Choose a reason for hiding this comment

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

LGTM

- type: command
command: kubectl -n ${KUTTL_TEST_DELETE_NAMESPACE} describe pods --selector postgres-operator.crunchydata.com/cluster=delete-namespace
- namespace: ${KUTTL_TEST_DELETE_NAMESPACE}
selector: postgres-operator.crunchydata.com/cluster=delete-namespace
Copy link
Contributor

Choose a reason for hiding this comment

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

⛏️ Missing newlines on a few of the files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants