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
Bug 1907888: Fix pipeline list page loader #7547
Bug 1907888: Fix pipeline list page loader #7547
Conversation
/kind bug |
@karthikjeeyar: This pull request references Bugzilla bug 1907888, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest Looks good on a high level, makes sense that's why it's happening. Want to investigate the code a bit more before I approve. |
7acbbc7
to
a333500
Compare
@karthikjeeyar: This pull request references Bugzilla bug 1907888, which is valid. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
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.
Sorry, got to this now, not sure what I missed from my first look but there are some comments on your added tests and I think I need to clarify to the team when null
vs loading
is needed.
if (!props.pipeline.loaded) { | ||
return null; | ||
} | ||
if (props.pipeline.loaded && pipelineData.length < 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 (props.pipeline.loaded && pipelineData.length < 1) { | |
if (pipelineData.length === 0) { |
Best be explicit and not mathematically correct 🙂
Also, don't need to include the inverse of previous boolean statement.
it('Should not render if the firehose call is not yet loaded', () => { | ||
expect(wrapper.html()).toBeNull(); | ||
}); |
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.
We should always favour loading spinners... There is almost never a good reason to do null if the content is still being processed by a hook or firehose.
if (!props.pipeline.loaded) { | ||
return null; | ||
} | ||
if (props.pipeline.loaded && pipelineData.length < 1) { | ||
return ( | ||
<div className="cos-status-box"> | ||
<div className="text-center">No {PipelineModel.labelPlural} Found</div> |
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 needs to be translated... mind adding this to your PR?
|
||
it('Should render No Pipelines found text if the data is empty', () => { | ||
wrapper.setProps({ pipeline: { data: [], loaded: true } }); | ||
expect(wrapper.find('div.text-center').text()).toBe('No Pipelines Found'); |
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 am not happy with these kind of tests... they are brittle and tie themselves to the exact implementation. If we swapped the divs out for PF components, this test would fail, but effectively not useful to us in anyway. If we changed the text, that would also not be ideal.
Perhaps the test here should be you don't render the ListPage 🤔
const firehoseComponent = wrapper.find(Firehose); | ||
|
||
expect(firehoseComponent.exists()).toBeTruthy(); |
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.
Let's not write tests against how we load data... this test serves just to bind our implementation to Firehose. Really what we want to do is not worry about how it gets the data and that it just renders the needed wrapper.
.../packages/pipelines-plugin/src/components/pipelines/list-page/PipelineAugmentRunsWrapper.tsx
Outdated
Show resolved
Hide resolved
d387720
to
d1660b2
Compare
d1660b2
to
040bc7f
Compare
57b1893
to
9711a9f
Compare
.../packages/pipelines-plugin/src/components/pipelines/list-page/PipelineAugmentRunsWrapper.tsx
Outdated
Show resolved
Hide resolved
9711a9f
to
e1a50cd
Compare
...ines-plugin/src/components/pipelines/list-page/__tests__/PipelineAugmentRunsWrapper.spec.tsx
Outdated
Show resolved
Hide resolved
e1a50cd
to
b434822
Compare
/lgtm |
}); | ||
|
||
it('Should render loader if data not yet loaded', () => { | ||
expect(wrapper.find(LoadingBox).exists()).toBeTruthy(); |
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, we should always equate booleans to their boolean value.
expect(wrapper.find(LoadingBox).exists()).toBeTruthy(); | |
expect(wrapper.find(LoadingBox).exists()).toBe(true); |
It's not wrong to stay truthy (true is truthy lol), it's just a bit inaccurate on a principle basis.
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 indifferent if this changes before merging. We need a linter to check for .exists()
and .tobeTruthy()
on the same expect. Update our Linter ticket: https://issues.redhat.com/browse/ODC-5300
/retest Please review the full test history for this PR and help us cut down flakes. |
7 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@karthikjeeyar: The specified target(s) for
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test e2e-gcp-console |
/retest Please review the full test history for this PR and help us cut down flakes. |
16 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@karthikjeeyar: All pull requests linked via external trackers have merged: Bugzilla bug 1907888 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes: https://issues.redhat.com/browse/ODC-5264
Analysis / Root cause:
"Pipelines" list page shows a message "No pipelines found" before it loads the data
Solution Description:
Do not render the
No pipelines found
text before the firehose call loads the data.Screenshots:
Unit test coverage report:
Browser conformance: