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

feat: Gingko tests for Join Hub agent #104

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Conversation

Arvindthiru
Copy link
Contributor

@Arvindthiru Arvindthiru commented Jun 17, 2022

Description of your changes

Also fixes #84 Removes the last file with ginkgo and gomega direct imports instead of dot imports

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@Arvindthiru Arvindthiru changed the title Gingko tests for Join Hub agent feat: Gingko tests for Join Hub agent Jun 17, 2022
@@ -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",
Copy link
Contributor Author

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 ""

Copy link
Contributor

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 ""

Copy link
Contributor Author

@Arvindthiru Arvindthiru Jun 23, 2022

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
Screen Shot 2022-06-22 at 5 45 51 PM

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@Arvindthiru Arvindthiru marked this pull request as ready for review June 21, 2022 20:48
@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov upload limit reached ⚠️

This org is currently on the free Basic Plan; which includes 250 free private repo uploads each rolling month. This limit has been reached and additional reports cannot be generated. For unlimited uploads, upgrade to our pro plan.

Do you have questions or need help? Connect with our sales team today at [email protected]

@@ -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",
Copy link
Contributor

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 ""

@helayoty helayoty requested a review from ryanzhang-oss June 28, 2022 19:40
joinedCondition := metav1.Condition{
Type: fleetv1alpha1.ConditionTypeInternalMemberClusterJoin,
Status: metav1.ConditionTrue,
Reason: reasonMemberClusterJoined,
Copy link
Contributor

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

Copy link
Contributor Author

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

@Arvindthiru Arvindthiru force-pushed the JoinIC branch 2 times, most recently from 2f862b9 to 9534496 Compare June 29, 2022 18:32
@Arvindthiru Arvindthiru merged commit a685cf1 into Azure:main Jun 29, 2022
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.

Ginko/ gomega import
3 participants