Skip to content

[Lens][Unified Field list] Add functional tests to fields lists and summary popover#143747

Merged
dej611 merged 14 commits intoelastic:mainfrom
dej611:tests/138724
Oct 27, 2022
Merged

[Lens][Unified Field list] Add functional tests to fields lists and summary popover#143747
dej611 merged 14 commits intoelastic:mainfrom
dej611:tests/138724

Conversation

@dej611
Copy link
Copy Markdown
Contributor

@dej611 dej611 commented Oct 20, 2022

Summary

Fixes #138724

This PR adds some functional tests for Lens fields list and adds some extra data-test-subject props to component to make them testable.

The following scenarios have been covered:

  • Check availability and empty fields groups
  • Check popup stats for field types
    • check for Top values charts
      • check for values + other label
    • check for histogram
    • check for unsupported fields (geo_point)
    • check for runtime fields (number + keyword)
  • Define a filter + check how popup stats are affected
  • Define a filter to exclude all fields + check how popup stats are affected
  • if dataView has a timeField check how fields list changes on date change

All checks are performed for regular dataView (with timeField), for ad-hoc (with time-field) and an ad-hoc (without time-field).

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@dej611 dej611 added Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v8.6.0 labels Oct 20, 2022
@dej611 dej611 requested a review from a team as a code owner October 20, 2022 13:24
Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Added some possible extensions to cover a few cases more that could become problematic

@dej611 dej611 requested a review from a team as a code owner October 26, 2022 09:01
Copy link
Copy Markdown
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Thanks for adding more tests! 👍

defaultMessage: 'Top values',
}),
id: 'topValues',
'data-test-subj': `${dataTestSubject}-topValues`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'data-test-subj': `${dataTestSubject}-topValues`,
'data-test-subj': `${dataTestSubject}-buttonGroup-topValuesButton`,

defaultMessage: 'Distribution',
}),
id: 'histogram',
'data-test-subj': `${dataTestSubject}-distribution`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
'data-test-subj': `${dataTestSubject}-distribution`,
'data-test-subj': `${dataTestSubject}-buttonGroup-distributionButton`,

})}
</EuiText>
</>
<EuiText size="s" data-test-subj="lnsFieldListPanel-missingContent">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<EuiText size="s" data-test-subj="lnsFieldListPanel-missingContent">
<EuiText size="s" data-test-subj="lnsFieldListPanel-missingFieldStats">

}
if (!params.supported) {
return (
<EuiText data-test-subj="lnsFieldListPanel-missingContent">{params.element}</EuiText>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
<EuiText data-test-subj="lnsFieldListPanel-missingContent">{params.element}</EuiText>
<EuiText data-test-subj="lnsFieldListPanel-missingFieldStats">{params.element}</EuiText>

overrideMissingContent?: (params: {
element: JSX.Element;
noDataFound?: boolean;
supported?: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also merge noDataFound?: boolean; and supported?: boolean; into a single reason?: 'no-data' | 'unsupported' prop.

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #44 / APM API tests basic no data Storage details when data is loaded returns correct stats for processor events

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.3MB 1.3MB +262.0B
unifiedFieldList 55.1KB 55.2KB +115.0B
total +377.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

LGTM 👌🏼 did you managed to run flaky test runner x times to make sure it doesn't introduce flakiness? 🙏🏼

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Oct 27, 2022

@dej611 dej611 merged commit 2efad9d into elastic:main Oct 27, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.6.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lens] Add functional tests for various conditions of field list existence and popover summaries

6 participants