-
Notifications
You must be signed in to change notification settings - Fork 31
chore: refactor test resource applier #2731
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
base: main
Are you sure you want to change the base?
Conversation
| testutils "github.com/kyma-project/telemetry-manager/internal/utils/test" | ||
| "github.com/kyma-project/telemetry-manager/test/testkit/assert" | ||
| kitk8s "github.com/kyma-project/telemetry-manager/test/testkit/k8s" | ||
| "github.com/kyma-project/telemetry-manager/test/testkit/k8s/objects" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "github.com/kyma-project/telemetry-manager/test/testkit/k8s/objects" | |
| kitk8sobjects "github.com/kyma-project/telemetry-manager/test/testkit/k8s/objects" |
let's use the alias here the same way you did it in the actual tests
| name types.NamespacedName, | ||
| resourceName string, | ||
| ) { | ||
| type ReadinessCheckFunc func(t *testing.T, name types.NamespacedName) (bool, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to export this type?
| return nil | ||
| } | ||
|
|
||
| func AllObjectsDeleted(resources ...client.Object) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to export this function?
| return nil | ||
| } | ||
|
|
||
| func DeleteObjectsIgnoringNotFound(resources ...client.Object) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to export this function?
| return labelMatches(labels, kitk8sobjects.PersistentLabelName, "true") | ||
| } | ||
|
|
||
| func ResetTelemetryResource(t *testing.T, previous operatorv1alpha1.Telemetry) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to export this function?
Description
Changes proposed in this pull request (what was done and why):
Changes refer to particular issues, PRs or documents:
Traceability
Related Issuessection.