Skip to content

Conversation

@mfrancisc
Copy link
Contributor

@mfrancisc mfrancisc commented Jan 24, 2025

e2e tests for codeready-toolchain/host-operator#1130

Verifying that once we update the TierTemplate.Spce.TemplateObjects field or the NSTemplateTier.Spec.Parameters a new ttr's are created.

Jira: https://issues.redhat.com/browse/KUBESAW-257

@mfrancisc
Copy link
Contributor Author

/retest

updated host pr

Copy link
Collaborator

@MatousJobanek MatousJobanek left a comment

Choose a reason for hiding this comment

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

Looks good

Comment on lines +1046 to +1068
// GreaterOrEqual checks if the number of TTRs is greater or equal than the expected one
func GreaterOrEqual(count int) TierTemplateRevisionWaitCriterion {
return TierTemplateRevisionWaitCriterion{
Match: func(actual []toolchainv1alpha1.TierTemplateRevision) bool {
return len(actual) >= count
},
Diff: func(actual []toolchainv1alpha1.TierTemplateRevision) string {
return fmt.Sprintf("number of ttrs %d is not greater or equal than %d \n", len(actual), count)
},
}
}

// LessOrEqual checks if the number of TTRs is less or equal than the expected one
func LessOrEqual(count int) TierTemplateRevisionWaitCriterion {
return TierTemplateRevisionWaitCriterion{
Match: func(actual []toolchainv1alpha1.TierTemplateRevision) bool {
return len(actual) <= count
},
Diff: func(actual []toolchainv1alpha1.TierTemplateRevision) string {
return fmt.Sprintf("number of ttrs %d is not less or equal than %d \n", len(actual), count)
},
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

btw, these could be generic functions available as part of the new wait.For API
but that's for later, not for this PR 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, not huge expert and fan of generic code, but I agree it might make sense.

Actually there's also a lot of margin for improvement in the assertions of the TTRs as well. We can do those later if that makes sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

As mentioned during the sync call, I found a way we can use the standard assertion functions
#1073 (comment)

@mfrancisc
Copy link
Contributor Author

@MatousJobanek sorry, I've pushed few other fixes after you approved. Could you PTAL at 719c2a1

I've realized later that there were some problems with the test. Sorry for that!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 7, 2025

@openshift-ci
Copy link

openshift-ci bot commented Feb 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MatousJobanek, mfrancisc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,mfrancisc]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mfrancisc mfrancisc merged commit 47ac084 into codeready-toolchain:master Feb 10, 2025
8 of 9 checks passed
@mfrancisc mfrancisc deleted the difftiertemplate branch February 10, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants