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

Bug 1907888: Fix pipeline list page loader #7547

Merged

Conversation

karthikjeeyar
Copy link
Contributor

@karthikjeeyar karthikjeeyar commented Dec 15, 2020

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:
pipeline-loader-text

Unit test coverage report:

image

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@karthikjeeyar karthikjeeyar changed the title Fix pipeline list page loader Bug 1907888: Fix pipeline list page loader Dec 15, 2020
@karthikjeeyar
Copy link
Contributor Author

/kind bug

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. kind/bug Categorizes issue or PR as related to a bug. labels Dec 15, 2020
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1907888: Fix pipeline list page loader

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.

@andrewballantyne
Copy link
Contributor

/retest
/assign

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.

@openshift-ci-robot
Copy link
Contributor

@karthikjeeyar: This pull request references Bugzilla bug 1907888, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1907888: Fix pipeline list page loader

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.

@karthikjeeyar
Copy link
Contributor Author

/retest

Copy link
Contributor

@andrewballantyne andrewballantyne left a 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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines 27 to 36
it('Should not render if the firehose call is not yet loaded', () => {
expect(wrapper.html()).toBeNull();
});
Copy link
Contributor

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>
Copy link
Contributor

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');
Copy link
Contributor

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 🤔

Comment on lines 38 to 40
const firehoseComponent = wrapper.find(Firehose);

expect(firehoseComponent.exists()).toBeTruthy();
Copy link
Contributor

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.

@karthikjeeyar karthikjeeyar force-pushed the pipeline-list-loader branch 2 times, most recently from d387720 to d1660b2 Compare December 17, 2020 11:06
@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Dec 17, 2020
@karthikjeeyar karthikjeeyar force-pushed the pipeline-list-loader branch 2 times, most recently from 57b1893 to 9711a9f Compare December 17, 2020 14:02
@debsmita1
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2020
});

it('Should render loader if data not yet loaded', () => {
expect(wrapper.find(LoadingBox).exists()).toBeTruthy();
Copy link
Contributor

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.

Suggested change
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.

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

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

7 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

@karthikjeeyar: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test analyze
  • /test backend
  • /test e2e-gcp-console
  • /test frontend
  • /test images
  • /test kubevirt-plugin

Use /test all to run the following jobs:

  • pull-ci-openshift-console-master-analyze
  • pull-ci-openshift-console-master-backend
  • pull-ci-openshift-console-master-e2e-gcp-console
  • pull-ci-openshift-console-master-frontend
  • pull-ci-openshift-console-master-images

In response to this:

/test ci/prow/e2e-gcp-console

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.

@karthikjeeyar
Copy link
Contributor Author

/test e2e-gcp-console

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

16 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 092f305 into openshift:master Dec 22, 2020
@openshift-ci-robot
Copy link
Contributor

@karthikjeeyar: All pull requests linked via external trackers have merged:

Bugzilla bug 1907888 has been moved to the MODIFIED state.

In response to this:

Bug 1907888: Fix pipeline list page loader

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.

@spadgett spadgett added this to the v4.7 milestone Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants