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

[Infrastructure UI] Flyout metadata tests #153581

Closed

Conversation

jennypavlova
Copy link
Member

@jennypavlova jennypavlova commented Mar 23, 2023

Summary

Related to #150893

This PR adds tests for the flyout feature. Most of the changes are adding test ids and helpers and the actual tests you can see in metadata.test.tsx and hosts view functional test

Functional Test

Added a check for open/close of the flyout and metadata tab title visibility - this can be expanded when the filtering functionality is added

Component Test

As we have many cases based on the metadata response I added a separate test for the metadata component. Usually, we don't have this approach but some cases like the error/no data case are hard to cover only with a functional test.

@jennypavlova jennypavlova self-assigned this Mar 23, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@jennypavlova jennypavlova added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Mar 23, 2023
@@ -26,7 +26,7 @@ export interface TabProps {
node: HostNodeRow;
}

const Metadata = ({ node, currentTimeRange }: TabProps) => {
export const Metadata = ({ node, currentTimeRange }: TabProps) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Exported for testing purposes

@@ -0,0 +1,40 @@
/*
Copy link
Member Author

Choose a reason for hiding this comment

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

I added this wrapper to have it shared for all components and make it easier to test the components without wrapping them in each test - we can expand it with core services mocks if needed for other tests.

jest.mock('../../../../../../containers/metrics_source');
jest.mock('../../../../metric_detail/hooks/use_metadata');

const metadataProps: TabProps = {
Copy link
Member Author

Choose a reason for hiding this comment

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

I keep the whole object to match the type restriction

@jennypavlova jennypavlova marked this pull request as ready for review March 23, 2023 18:52
@jennypavlova jennypavlova requested a review from a team as a code owner March 23, 2023 18:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@jennypavlova jennypavlova force-pushed the 150893-flyout-metadata-tests branch from 1cb8a4d to 4a04953 Compare March 24, 2023 16:43
@jennypavlova jennypavlova requested review from a team as code owners March 24, 2023 16:43
@jennypavlova jennypavlova requested a review from a team March 24, 2023 16:43
@jennypavlova jennypavlova requested review from a team as code owners March 24, 2023 16:43
@jennypavlova jennypavlova requested review from a team as code owners March 24, 2023 16:43
@jennypavlova jennypavlova requested a review from a team March 24, 2023 16:43
@jennypavlova jennypavlova requested review from a team as code owners March 24, 2023 16:43
@jennypavlova jennypavlova deleted the 150893-flyout-metadata-tests branch March 24, 2023 16:47
@kibana-ci
Copy link
Collaborator

kibana-ci commented Mar 24, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Threat Intelligence Tests #4 / Indicators Indicators timeline interactions should add entry in timeline when clicking in an indicator flyout overview block
  • [job] [logs] Threat Intelligence Tests #4 / Indicators Indicators timeline interactions should add entry in timeline when clicking in an indicator flyout overview block
  • [job] [logs] Threat Intelligence Tests #4 / Indicators Indicators timeline interactions should add entry in timeline when clicking in an indicator flyout overview tab table row

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
alerting 31 33 +2
apm 1404 1411 +7
cases 564 565 +1
cloudSecurityPosture 141 145 +4
controls 150 153 +3
dashboard 377 383 +6
data 458 456 -2
dataViewEditor 64 65 +1
discover 445 446 +1
enterpriseSearch 2018 2024 +6
fileUpload 207 205 -2
fleet 783 796 +13
guidedOnboarding 23 28 +5
infra 1266 1282 +16
lens 895 891 -4
maps 970 969 -1
ml 1718 1720 +2
observability 551 513 -38
presentationUtil 149 155 +6
profiling 125 128 +3
securitySolution 3735 3792 +57
synthetics 1369 1370 +1
transform 308 313 +5
triggersActionsUi 547 550 +3
unifiedFieldList 85 91 +6
visDefaultEditor 124 120 -4
total +97

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/alerts-as-data-utils 12 14 +2
@kbn/core-elasticsearch-client-server-internal 14 13 -1
@kbn/core-elasticsearch-client-server-mocks 34 33 -1
@kbn/core-elasticsearch-server 53 54 +1
@kbn/core-notifications-browser 23 27 +4
@kbn/core-saved-objects-base-server-internal 36 56 +20
@kbn/core-saved-objects-server 98 99 +1
@kbn/dom-drag-drop - 29 +29
@kbn/ml-agg-utils 59 63 +4
@kbn/object-versioning - 48 +48
@kbn/security-solution-side-nav - 30 +30
@kbn/securitysolution-grouping 13 15 +2
@kbn/slo-schema 75 78 +3
actions 251 254 +3
alerting 486 531 +45
assetManager - 3 +3
cases 77 79 +2
contentManagement 96 104 +8
controls 268 269 +1
customIntegrations 88 156 +68
data 2584 2577 -7
embeddable 436 441 +5
enterpriseSearch 9 7 -2
fleet 989 991 +2
lens 596 592 -4
lists 93 94 +1
observability 622 644 +22
security 89 94 +5
taskManager 41 40 -1
unifiedFieldList 242 250 +8
usageCollection 15 16 +1
total +302

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/object-versioning - 1 +1
embeddable 9 11 +2
observability 43 44 +1
total +4

Async chunks

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

id before after diff
advancedSettings 50.5KB 50.7KB +187.0B
aiops 753.4KB 753.1KB -343.0B
apm 3.8MB 3.8MB +15.3KB
canvas 1.0MB 1.0MB +8.0B
cases 364.0KB 363.7KB -288.0B
cloudDefend 245.9KB 254.2KB +8.3KB
cloudSecurityPosture 147.9KB 152.6KB +4.7KB
console 417.9KB 417.9KB +17.0B
controls 179.2KB 189.4KB +10.3KB
crossClusterReplication 168.2KB 168.2KB +12.0B
dashboard 385.5KB 387.9KB +2.5KB
data 52.7KB 52.6KB -39.0B
dataViewEditor 36.7KB 39.7KB +3.0KB
dataViewFieldEditor 156.1KB 156.1KB +8.0B
dataViewManagement 118.6KB 118.6KB +18.0B
dataVisualizer 366.1KB 366.1KB +40.0B
discover 395.5KB 397.4KB +2.0KB
enterpriseSearch 2.2MB 2.2MB +12.5KB
expressionError 13.2KB 13.2KB +2.0B
expressionPartitionVis 52.9KB 52.9KB +2.0B
expressionTagcloud 7.7KB 7.7KB +4.0B
expressionXY 120.1KB 120.0KB -72.0B
filesManagement 86.0KB 86.0KB +2.0B
fileUpload 853.4KB 852.8KB -605.0B
fleet 933.6KB 940.4KB +6.8KB
graph 453.2KB 453.2KB +4.0B
grokdebugger 59.1KB 59.1KB +2.0B
home 153.9KB 153.9KB +19.0B
imageEmbeddable 49.8KB 49.8KB +2.0B
indexLifecycleManagement 157.8KB 157.8KB +10.0B
indexManagement 524.7KB 525.5KB +721.0B
infra 1.3MB 1.3MB +10.9KB
ingestPipelines 443.0KB 443.0KB +20.0B
inputControlVis 49.9KB 49.9KB +2.0B
lens 1.3MB 1.3MB -8.1KB
licenseManagement 65.2KB 65.2KB +4.0B
lists 152.8KB 153.2KB +408.0B
maps 2.7MB 2.7MB -2.8KB
ml 3.4MB 3.4MB -3.4KB
monitoring 458.2KB 459.4KB +1.1KB
observability 1.1MB 1.1MB -2.6KB
osquery 1.1MB 1.1MB +557.0B
painlessLab 16.1KB 16.1KB +2.0B
presentationUtil 146.1KB 129.1KB -17.1KB
profiling 262.1KB 263.2KB +1.1KB
remoteClusters 84.9KB 84.9KB +10.0B
reporting 58.8KB 58.8KB -5.0B
rollup 131.2KB 131.2KB +6.0B
savedObjectsFinder 4.9KB 5.2KB +316.0B
savedObjectsManagement 87.6KB 87.6KB +10.0B
searchprofiler 159.0KB 159.0KB +2.0B
security 556.9KB 557.1KB +214.0B
securitySolution 15.7MB 15.8MB +101.6KB
sessionView 382.9KB 383.0KB +4.0B
snapshotRestore 269.6KB 269.7KB +24.0B
spaces 174.6KB 174.6KB +8.0B
stackAlerts 80.3KB 80.3KB +6.0B
stackConnectors 419.5KB 419.5KB +12.0B
synthetics 1.4MB 1.4MB +12.6KB
threatIntelligence 52.5KB 52.3KB -210.0B
transform 371.0KB 372.9KB +1.8KB
triggersActionsUi 1.4MB 1.4MB +461.0B
uiActionsEnhanced 133.2KB 133.2KB +6.0B
unifiedFieldList 50.6KB 45.8KB -4.9KB
unifiedHistogram 38.3KB 38.3KB +2.0B
unifiedSearch 266.8KB 266.8KB -56.0B
upgradeAssistant 152.2KB 152.3KB +60.0B
ux 160.6KB 160.8KB +222.0B
visDefaultEditor 142.6KB 141.0KB -1.6KB
visTypeTimeseries 507.5KB 507.6KB +10.0B
visTypeVega 1.7MB 1.7MB -10.8KB
visTypeVislib 340.0KB 339.7KB -211.0B
visualizations 259.6KB 259.4KB -178.0B
watcher 273.3KB 273.3KB +8.0B
total +144.5KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/core-saved-objects-base-server-internal 6 7 +1
@kbn/dom-drag-drop - 4 +4
@kbn/securitysolution-grouping 5 4 -1
actions 24 26 +2
alerting 41 42 +1
apm 65 108 +43
cases 28 30 +2
contentManagement 3 4 +1
lens 52 49 -3
osquery 7 6 -1
taskManager 7 6 -1
triggersActionsUi 50 49 -1
usageCollection 1 2 +1
total +48

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
alerting 41.8KB 44.2KB +2.4KB
apm 32.2KB 31.7KB -506.0B
cases 133.2KB 133.3KB +186.0B
charts 45.8KB 45.8KB +4.0B
cloudSecurityPosture 11.0KB 11.3KB +261.0B
contentManagement 5.6KB 7.2KB +1.5KB
controls 32.1KB 33.3KB +1.1KB
core 350.8KB 351.9KB +1.1KB
customIntegrations 7.4KB 8.2KB +850.0B
data 407.4KB 403.8KB -3.6KB
dataViewEditor 10.5KB 10.7KB +141.0B
dataViewFieldEditor 23.3KB 23.3KB +2.0B
dataViews 44.2KB 43.8KB -327.0B
discover 28.0KB 28.0KB -52.0B
embeddable 75.3KB 75.7KB +500.0B
enterpriseSearch 29.9KB 30.3KB +412.0B
esUiShared 152.4KB 152.4KB +80.0B
fleet 125.1KB 125.7KB +687.0B
guidedOnboarding 23.7KB 26.9KB +3.2KB
infra 87.7KB 88.0KB +315.0B
interactiveSetup 58.6KB 58.6KB +2.0B
kbnUiSharedDeps-css 314.9KB 315.6KB +655.0B
kbnUiSharedDeps-npmDll 5.4MB 5.4MB +9.7KB
kbnUiSharedDeps-srcJs 2.2MB 2.2MB -46.0B
kibanaUtils 69.7KB 69.7KB +45.0B
maps 53.1KB 53.4KB +279.0B
ml 79.3KB 79.6KB +271.0B
observability 89.2KB 88.2KB -1016.0B
osquery 50.3KB 50.3KB +50.0B
presentationUtil 31.6KB 36.0KB +4.4KB
reporting 42.5KB 42.5KB +2.0B
security 60.7KB 60.8KB +51.0B
securitySolution 53.5KB 57.9KB +4.4KB
share 51.5KB 51.5KB +2.0B
synthetics 26.6KB 26.6KB +66.0B
threatIntelligence 31.3KB 31.7KB +336.0B
transform 16.8KB 17.7KB +898.0B
triggersActionsUi 80.6KB 83.6KB +3.0KB
unifiedFieldList 39.0KB 48.0KB +9.0KB
usageCollection 5.0KB 5.0KB +8.0B
visTypeGauge 12.1KB 12.0KB -32.0B
visTypeHeatmap 12.6KB 12.5KB -48.0B
visTypeMetric 10.9KB 10.9KB -16.0B
visTypePie 10.3KB 10.2KB -32.0B
visTypeXy 31.1KB 30.9KB -192.0B
visualizations 56.9KB 57.1KB +250.0B
total +40.4KB

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
alert 100 101 +1
lens 6 4 -2
query 6 5 -1
slo - 25 +25
space 9 8 -1
typeMigrationVersion - 1 +1
total +23
Unknown metric groups

API count

id before after diff
@kbn/alerts-as-data-utils 12 14 +2
@kbn/core-elasticsearch-client-server-internal 16 22 +6
@kbn/core-elasticsearch-client-server-mocks 38 37 -1
@kbn/core-elasticsearch-server 103 108 +5
@kbn/core-notifications-browser 35 39 +4
@kbn/core-saved-objects-api-browser 107 109 +2
@kbn/core-saved-objects-api-server 334 338 +4
@kbn/core-saved-objects-base-server-internal 47 76 +29
@kbn/core-saved-objects-server 489 491 +2
@kbn/dom-drag-drop - 45 +45
@kbn/ml-agg-utils 83 87 +4
@kbn/object-versioning - 53 +53
@kbn/security-solution-side-nav - 30 +30
@kbn/security-solution-storybook-config - 2 +2
@kbn/securitysolution-grouping 14 20 +6
@kbn/slo-schema 75 78 +3
@kbn/utility-types 35 36 +1
actions 256 259 +3
alerting 497 550 +53
assetManager - 3 +3
cases 94 96 +2
contentManagement 110 118 +8
controls 272 273 +1
customIntegrations 107 175 +68
data 3280 3273 -7
embeddable 539 544 +5
enterpriseSearch 9 7 -2
files 214 215 +1
fleet 1094 1096 +2
lens 690 686 -4
lists 208 210 +2
observability 628 650 +22
security 269 280 +11
securitySolution 117 118 +1
taskManager 83 82 -1
unifiedFieldList 267 276 +9
usageCollection 58 55 -3
total +371

async chunk count

id before after diff
controls 5 7 +2
infra 19 24 +5
securitySolution 42 43 +1
total +8

ESLint disabled in files

id before after diff
@kbn/security-solution-side-nav - 1 +1
@kbn/security-solution-storybook-config - 1 +1
apm 13 11 -2
profiling 0 1 +1
securitySolution 78 80 +2
total +3

ESLint disabled line counts

id before after diff
@kbn/security-solution-side-nav - 1 +1
alerting 77 78 +1
apm 71 70 -1
assetManager - 1 +1
esUiShared 11 12 +1
infra 49 47 -2
maps 41 46 +5
ml 556 555 -1
observability 53 50 -3
profiling 9 16 +7
securitySolution 428 436 +8
transform 31 32 +1
triggersActionsUi 117 118 +1
total +19

miscellaneous assets size

id before after diff
cloudSecurityPosture 162.3KB 150.8KB -11.5KB
infra 812.2KB 1.2MB ⚠️ +387.0KB
total +375.5KB

References to deprecated APIs

id before after diff
@kbn/core-saved-objects-api-browser 54 60 +6
@kbn/core-saved-objects-api-server-internal 0 8 +8
@kbn/core-saved-objects-browser-internal 238 251 +13
@kbn/core-saved-objects-browser-mocks 32 35 +3
@kbn/core-saved-objects-import-export-server-internal 56 58 +2
@kbn/core-saved-objects-server-internal 4 6 +2
apm 38 34 -4
canvas 151 152 +1
dataViews 150 148 -2
fleet 51 62 +11
graph 82 88 +6
infra 112 100 -12
lists 93 95 +2
securitySolution 361 415 +54
visualizations 132 127 -5
total +85

Total ESLint disabled count

id before after diff
@kbn/security-solution-side-nav - 2 +2
@kbn/security-solution-storybook-config - 1 +1
alerting 78 79 +1
apm 84 81 -3
assetManager - 1 +1
esUiShared 11 12 +1
infra 57 55 -2
maps 69 74 +5
ml 559 558 -1
observability 59 56 -3
profiling 9 17 +8
securitySolution 506 516 +10
transform 34 35 +1
triggersActionsUi 123 124 +1
total +22

History

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

cc @jennypavlova

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants