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

refactor e2e for speed and clarity, add helpers #244

Closed
wants to merge 1 commit into from

Conversation

joelanford
Copy link
Member

@joelanford joelanford commented Jun 1, 2023

Description

This PR improves the install e2e test by:

  • Using a smaller and controlled-by-us catalog image (though it is still hosted/pulled from quay). This reduces e2e time from ~9m to ~5m.
  • Adding helpers to make it easier to check conditions
  • Eventually blocks now fail early if unexpected failures occur, which makes e2e runs fail faster rather than being required to wait the full Eventually timeout.

This should mostly eliminate the flakes related to catalog processing mentioned in #215.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
Comment on lines +124 to +132
var conditions []metav1.Condition
switch v := obj.(type) {
case *catalogd.Catalog:
conditions = v.Status.Conditions
case *operatorv1alpha1.Operator:
conditions = v.Status.Conditions
default:
return StopTrying(fmt.Sprintf("cannot get conditions for unknown object type %T", obj))
}
Copy link
Member Author

Choose a reason for hiding this comment

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

An earlier iteration of this section of code called a separate function I had written that generically:

  • converted to unstructured
  • extracted "status.conditions" into []interface{}
  • marshaled that to JSON
  • unmarshaled the JSON into []metav1.Condition

That code generically handled anything that had status.conditions with type []metav1.Condition, but it seemed a bit hacky/overkill. I'm happy to go back to that, or entertain other options as well.

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

super teeny non-blocking nit, otherwise looks good to me

test/e2e/install_test.go Show resolved Hide resolved
@joelanford
Copy link
Member Author

joelanford commented Jun 1, 2023

/hold
Until after #216 merges (and I'll rebase afterward)

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 1, 2023
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2023
@openshift-merge-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@joelanford joelanford closed this Aug 15, 2023
@joelanford joelanford deleted the refactor-e2e branch June 20, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants