-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: Gingko tests for Join Hub agent #104
Conversation
pkg/controllers/membercluster/membercluster_controller_integration_test.go
Show resolved
Hide resolved
pkg/controllers/membercluster/membercluster_controller_integration_test.go
Outdated
Show resolved
Hide resolved
@@ -214,7 +214,7 @@ func (r *Reconciler) checkAndCreateNamespace(ctx context.Context, memberCluster | |||
klog.InfoS("namespace doesn't exist for member cluster", | |||
"namespace", nsName, "memberCluster", memberCluster.Name) | |||
// make sure the entire namespace is removed if the member cluster is deleted | |||
ownerRef := metav1.OwnerReference{APIVersion: memberCluster.APIVersion, Kind: memberCluster.Kind, | |||
ownerRef := metav1.OwnerReference{APIVersion: fleetv1alpha1.GroupVersion.Version, Kind: "MemberCluster", |
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.
Had to make this change because for some reason the member cluster I create through the Integration test has empty TypeMeta and ownerRef obj requires APIVersion and Kind to have values other than ""
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.
Please make sure you understand the reason for any change to the product code because of a test problem. I don't why the memberCluster.Kind is ""
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.
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.
Please make sure you figure this out. We cannot put code in production with unknown behaviors.
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.
I'm not exactly sure why this is happening either it works on kind clusters but in gingko's test environment I'm facing this issue I'm explicitly setting the TypeMeta when I'm creating the member cluster here I also tried not setting it
Can you try to use the e2e test to verify if this is a ginkgo framework issue or a code issue?
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.
I removed the changes made to ownerRef and ran the e2e tests with current main and it worked
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.
Since this is not blocking opened an issue to track this #131
pkg/controllers/membercluster/membercluster_controller_integration_test.go
Show resolved
Hide resolved
Codecov upload limit reached
|
@@ -214,7 +214,7 @@ func (r *Reconciler) checkAndCreateNamespace(ctx context.Context, memberCluster | |||
klog.InfoS("namespace doesn't exist for member cluster", | |||
"namespace", nsName, "memberCluster", memberCluster.Name) | |||
// make sure the entire namespace is removed if the member cluster is deleted | |||
ownerRef := metav1.OwnerReference{APIVersion: memberCluster.APIVersion, Kind: memberCluster.Kind, | |||
ownerRef := metav1.OwnerReference{APIVersion: fleetv1alpha1.GroupVersion.Version, Kind: "MemberCluster", |
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.
Please make sure you understand the reason for any change to the product code because of a test problem. I don't why the memberCluster.Kind is ""
pkg/controllers/membercluster/membercluster_controller_integration_test.go
Show resolved
Hide resolved
pkg/controllers/membercluster/membercluster_controller_integration_test.go
Outdated
Show resolved
Hide resolved
pkg/controllers/membercluster/membercluster_controller_integration_test.go
Show resolved
Hide resolved
joinedCondition := metav1.Condition{ | ||
Type: fleetv1alpha1.ConditionTypeInternalMemberClusterJoin, | ||
Status: metav1.ConditionTrue, | ||
Reason: reasonMemberClusterJoined, |
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.
nit: reason is not updated when the status is true
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.
This is the first time join condition is added to the membercluster
2f862b9
to
9534496
Compare
Description of your changes
Also fixes #84 Removes the last file with ginkgo and gomega direct imports instead of dot imports
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer