-
Notifications
You must be signed in to change notification settings - Fork 54
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
Refactoring Pact tests and adding parametrized states #391
Conversation
047be28
to
6ebc6c2
Compare
6ebc6c2
to
ff56922
Compare
393022a
to
49525e2
Compare
/retest |
49525e2
to
7d79269
Compare
if len(createdHasComp.Status.Conditions) > 1 { | ||
break | ||
} | ||
time.Sleep(10 * time.Second) |
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 use eventually, bad practice to use sleep in tests
if createdHasApp.Status.Conditions[0].Type == "Created" { | ||
break | ||
} | ||
} |
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 use eventually, bad practice to use sleep in tests
break | ||
} | ||
} | ||
time.Sleep(10 * time.Second) |
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 use eventually, bad practice to use sleep in tests
if len(createdHasComp2.Status.Conditions) > 1 { | ||
break | ||
} | ||
time.Sleep(10 * time.Second) |
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 use eventually, bad practice to use sleep in tests
createdHasComp2 := &appstudiov1alpha1.Component{} | ||
for i := 0; i < 12; i++ { | ||
gomega.Expect(k8sClient.Get(context.Background(), hasCompLookupKey2, createdHasComp2)).Should(gomega.Succeed()) | ||
if len(createdHasComp2.Status.Conditions) > 1 { |
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.
if conditions are not created this will result in panic
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.
My bad. I saw something wron
if len(createdHasApp.Status.Conditions) > 0 && strings.Contains(createdHasApp.Status.Devfile, ghCompName) { | ||
break | ||
} | ||
time.Sleep(10 * time.Second) |
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 use eventually, bad practice to use sleep in tests
}, timeout, interval).Should(gomega.BeTrue()) | ||
|
||
gomega.Eventually(func() bool { | ||
k8sClient.Get(context.Background(), hasAppLookupKey, createdHasApp) |
Check warning
Code scanning / gosec
Errors unhandled.
hasCompLookupKey := types.NamespacedName{Name: comp.name, Namespace: comp.app.namespace} | ||
createdHasComp := &appstudiov1alpha1.Component{} | ||
gomega.Eventually(func() bool { | ||
k8sClient.Get(context.Background(), hasCompLookupKey, createdHasComp) |
Check warning
Code scanning / gosec
Errors unhandled.
createdHasApp := &appstudiov1alpha1.Application{} | ||
|
||
gomega.Eventually(func() bool { | ||
k8sClient.Get(context.Background(), hasAppLookupKey, createdHasApp) |
Check warning
Code scanning / gosec
Errors unhandled.
/hold |
hasAppLookupKey := types.NamespacedName{Name: appName, Namespace: HASAppNamespace} | ||
createdHasApp := &appstudiov1alpha1.Application{} | ||
gomega.Eventually(func() bool { | ||
k8sClient.Get(context.Background(), hasAppLookupKey, createdHasApp) |
Check warning
Code scanning / gosec
Errors unhandled.
/unhold |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: flacatus, Katka92 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @maysunfaisal |
What does this PR do?:
Separate Pact tests related files to a separate package. Add parametrized states.
Which issue(s)/story(ies) does this PR fixes:
https://issues.redhat.com/browse/HAC-4879