Skip to content

Commit f1fdf49

Browse files
authored
Merge branch '3.0' into backport/backport-2412-to-3.0
2 parents 88c6437 + 577f78e commit f1fdf49

File tree

35 files changed

+561
-296
lines changed

35 files changed

+561
-296
lines changed

.cypress/integration/app_analytics_test/app_analytics.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ describe('Viewing application', () => {
318318
cy.get('[data-test-subj="spanDetailFlyout"]').should('not.exist');
319319
});
320320

321-
it('Opens trace detail flyout when Trace ID is clicked', () => {
321+
it('Opens trace detail flyout when Trace Id is clicked', () => {
322322
cy.get('[data-test-subj="app-analytics-traceTab"]').click();
323323
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
324324
cy.get('[title="03f9c770db5ee2f1caac0afc36db49ba"]').click();

.cypress/integration/trace_analytics_test/trace_analytics_services.spec.js

+29-10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
verify_traces_spans_data_grid_cols_exists,
1414
count_table_row,
1515
AUTH_SERVICE_SPAN_ID,
16+
INVALID_URL,
1617
} from '../../utils/constants';
1718
import { suppressResizeObserverIssue } from '../../utils/constants';
1819

@@ -93,19 +94,37 @@ describe('Testing services table', () => {
9394
});
9495
});
9596

96-
describe('Testing service view empty state', () => {
97-
beforeEach(() => {
98-
cy.visit(`app/observability-traces#/services/${SERVICE_NAME}`, {
97+
describe('Testing service view empty state and invalid url', () => {
98+
it('Renders service view empty state and invalid url', () => {
99+
cy.visit(`app/observability-traces#/services?serviceId=${SERVICE_NAME}`, {
99100
onBeforeLoad: (win) => {
100101
win.sessionStorage.clear();
101102
},
102103
});
103-
});
104-
105-
it('Renders service view empty state', () => {
104+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
106105
cy.contains('frontend-client').should('exist');
107-
cy.get('.euiText').contains('0').should('exist');
108-
cy.get('.euiText').contains('-').should('exist');
106+
cy.contains('No matches').should('exist');
107+
108+
// Renders service view invalid url state
109+
cy.visit(`app/observability-traces#/services?serviceId=${INVALID_URL}`, {
110+
onBeforeLoad: (win) => {
111+
win.sessionStorage.clear();
112+
},
113+
});
114+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
115+
cy.contains(`${INVALID_URL}`).should('exist');
116+
cy.get('.euiCallOut.euiCallOut--danger')
117+
.should('exist')
118+
.within(() => {
119+
cy.get('.euiCallOutHeader__title')
120+
.should('contain.text', `Error loading service: ${INVALID_URL}`);
121+
cy.get('p')
122+
.should(
123+
'contain.text',
124+
'The service name is invalid or could not be found. Please check the URL or try again.'
125+
);
126+
});
127+
cy.contains('No matches').should('exist');
109128
});
110129
});
111130

@@ -410,9 +429,9 @@ describe('Testing traces Spans table and verify columns functionality', () => {
410429
expandServiceView(1);
411430
verify_traces_spans_data_grid_cols_exists();
412431
cy.get('[data-test-subj="service-dep-table"]').should('exist');
413-
cy.get('.euiDataGridHeaderCell__content').contains('Span ID').click();
432+
cy.get('.euiDataGridHeaderCell__content').contains('Span Id').click();
414433
cy.get('.euiListGroupItem__label').contains('Hide column').click();
415-
cy.get('.euiDataGridHeaderCell__content').contains('Trace ID').click();
434+
cy.get('.euiDataGridHeaderCell__content').contains('Trace Id').click();
416435
cy.get('.euiListGroupItem__label').contains('Sort A-Z').click();
417436
cy.get('.euiDataGridHeaderCell__content').contains('Trace group').click();
418437
cy.get('.euiListGroupItem__label').contains('Move left').click();

.cypress/integration/trace_analytics_test/trace_analytics_traces.spec.js

+30-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/// <reference types="cypress" />
77

8-
import { setTimeFilter, SPAN_ID, TRACE_ID, SPAN_ID_TREE_VIEW } from '../../utils/constants';
8+
import { setTimeFilter, SPAN_ID, TRACE_ID, SPAN_ID_TREE_VIEW, INVALID_URL } from '../../utils/constants';
99

1010
describe('Testing traces table empty state', () => {
1111
beforeEach(() => {
@@ -124,6 +124,32 @@ describe('Testing trace view', () => {
124124
});
125125
});
126126

127+
describe('Testing trace view invalid url', () => {
128+
beforeEach(() => {
129+
cy.visit(`app/observability-traces#/traces?traceId=${INVALID_URL}`, {
130+
onBeforeLoad: (win) => {
131+
win.sessionStorage.clear();
132+
},
133+
});
134+
});
135+
136+
it('Handles a invalid trace url', () => {
137+
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
138+
cy.contains(`${INVALID_URL}`).should('exist');
139+
cy.get('.euiCallOut.euiCallOut--danger')
140+
.should('exist')
141+
.within(() => {
142+
cy.get('.euiCallOutHeader__title')
143+
.should('contain.text', `Error loading Trace Id: ${INVALID_URL}`);
144+
cy.get('p')
145+
.should(
146+
'contain.text',
147+
'The Trace Id is invalid or could not be found. Please check the URL or try again.'
148+
);
149+
});
150+
});
151+
});
152+
127153
describe('Testing traces table', () => {
128154
beforeEach(() => {
129155
cy.visit('app/observability-traces#/traces', {
@@ -137,7 +163,7 @@ describe('Testing traces table', () => {
137163
});
138164

139165
it('Renders the traces table and verify Table Column, Pagination and Rows Data ', () => {
140-
cy.get('.euiTableCellContent__text').contains('Trace ID').should('exist');
166+
cy.get('.euiTableCellContent__text').contains('Trace Id').should('exist');
141167
cy.get('.euiTableCellContent__text').contains('Trace group').should('exist');
142168
cy.get('.euiTableCellContent__text').contains('Duration (ms)').should('exist');
143169
cy.get('.euiTableCellContent__text').contains('Percentile in trace group').should('exist');
@@ -287,7 +313,7 @@ describe('Testing switch mode to jaeger', () => {
287313
cy.contains('No').should('exist');
288314
cy.contains('01/24/2023 08:33:35').should('exist');
289315
cy.contains('Latency (ms)').should('exist');
290-
cy.contains('Trace ID').should('exist');
316+
cy.contains('Trace Id').should('exist');
291317
cy.contains('Errors').should('exist');
292318
cy.contains('Last updated').should('exist');
293319
});
@@ -372,7 +398,7 @@ describe('Testing traces Custom source', () => {
372398
cy.get('.euiSelectableListItem').contains('Traces').click();
373399
cy.get('[data-test-subj="globalLoadingIndicator"]').should('not.exist');
374400

375-
cy.get('.euiDataGridHeaderCell__content').contains('Trace ID').should('exist');
401+
cy.get('.euiDataGridHeaderCell__content').contains('Trace Id').should('exist');
376402
cy.get('.euiDataGridHeaderCell__content').contains('Trace group').should('exist');
377403
cy.get('.euiDataGridHeaderCell__content').contains('Duration (ms)').should('exist');
378404
cy.get('.euiDataGridHeaderCell__content').contains('Percentile in trace group').should('exist');

.cypress/utils/constants.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const SPAN_ID_TREE_VIEW = 'fe4076542b41d40b';
2121
export const SERVICE_NAME = 'frontend-client';
2222
export const SERVICE_SPAN_ID = 'e275ac9d21929e9b';
2323
export const AUTH_SERVICE_SPAN_ID = '277a5934acf55dcf';
24+
export const INVALID_URL = 'invalid_url';
2425

2526
export const testDataSet = [
2627
{
@@ -154,8 +155,8 @@ export const suppressResizeObserverIssue = () => {
154155
};
155156

156157
export const verify_traces_spans_data_grid_cols_exists = () => {
157-
cy.get('.euiDataGridHeaderCell__content').contains('Span ID').should('exist');
158-
cy.get('.euiDataGridHeaderCell__content').contains('Trace ID').should('exist');
158+
cy.get('.euiDataGridHeaderCell__content').contains('Span Id').should('exist');
159+
cy.get('.euiDataGridHeaderCell__content').contains('Trace Id').should('exist');
159160
cy.get('.euiDataGridHeaderCell__content').contains('Operation').should('exist');
160161
cy.get('.euiDataGridHeaderCell__content').contains('Duration').should('exist');
161162
cy.get('.euiDataGridHeaderCell__content').contains('Start time').should('exist');

public/components/application_analytics/__tests__/__snapshots__/flyout.test.tsx.snap

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ exports[`Trace Detail Render Flyout component render trace detail 1`] = `
2828
/>
2929
</EuiSpacer>
3030
<div
31-
key="list-item-Trace ID"
31+
key="list-item-Trace Id"
3232
>
3333
<EuiDescriptionList
3434
align="center"
3535
compressed={true}
36-
data-test-subj="Trace IDDescriptionList"
36+
data-test-subj="Trace IdDescriptionList"
3737
listItems={
3838
Array [
3939
Object {
@@ -61,7 +61,7 @@ exports[`Trace Detail Render Flyout component render trace detail 1`] = `
6161
}
6262
}
6363
>
64-
Trace ID
64+
Trace Id
6565
</EuiText>,
6666
},
6767
]
@@ -70,7 +70,7 @@ exports[`Trace Detail Render Flyout component render trace detail 1`] = `
7070
>
7171
<dl
7272
className="euiDescriptionList euiDescriptionList--column euiDescriptionList--center euiDescriptionList--compressed"
73-
data-test-subj="Trace IDDescriptionList"
73+
data-test-subj="Trace IdDescriptionList"
7474
>
7575
<EuiDescriptionListTitle
7676
key="title-0"
@@ -104,7 +104,7 @@ exports[`Trace Detail Render Flyout component render trace detail 1`] = `
104104
<div
105105
className="euiTextColor euiTextColor--subdued"
106106
>
107-
Trace ID
107+
Trace Id
108108
</div>
109109
</EuiTextColor>
110110
</div>

public/components/application_analytics/__tests__/__snapshots__/log_config.test.tsx.snap

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exports[`Log Config component renders empty log config 1`] = `
2222
"getIsVisible$": [MockFunction],
2323
"globalSearch": Object {
2424
"getAllSearchCommands": [MockFunction],
25+
"unregisterSearchCommand": [MockFunction],
2526
},
2627
"logos": Object {
2728
"AnimatedMark": Object {
@@ -694,6 +695,7 @@ exports[`Log Config component renders with query 1`] = `
694695
"getIsVisible$": [MockFunction],
695696
"globalSearch": Object {
696697
"getAllSearchCommands": [MockFunction],
698+
"unregisterSearchCommand": [MockFunction],
697699
},
698700
"logos": Object {
699701
"AnimatedMark": Object {

public/components/application_analytics/__tests__/__snapshots__/service_config.test.tsx.snap

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ exports[`Service Config component renders empty service config 1`] = `
2222
"getIsVisible$": [MockFunction],
2323
"globalSearch": Object {
2424
"getAllSearchCommands": [MockFunction],
25+
"unregisterSearchCommand": [MockFunction],
2526
},
2627
"logos": Object {
2728
"AnimatedMark": Object {
@@ -1376,6 +1377,7 @@ exports[`Service Config component renders with one service selected 1`] = `
13761377
"getIsVisible$": [MockFunction],
13771378
"globalSearch": Object {
13781379
"getAllSearchCommands": [MockFunction],
1380+
"unregisterSearchCommand": [MockFunction],
13791381
},
13801382
"logos": Object {
13811383
"AnimatedMark": Object {

public/components/application_analytics/__tests__/__snapshots__/trace_config.test.tsx.snap

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exports[`Trace Config component renders empty trace config 1`] = `
2121
"getIsVisible$": [MockFunction],
2222
"globalSearch": Object {
2323
"getAllSearchCommands": [MockFunction],
24+
"unregisterSearchCommand": [MockFunction],
2425
},
2526
"logos": Object {
2627
"AnimatedMark": Object {
@@ -2473,6 +2474,7 @@ exports[`Trace Config component renders with one trace selected 1`] = `
24732474
"getIsVisible$": [MockFunction],
24742475
"globalSearch": Object {
24752476
"getAllSearchCommands": [MockFunction],
2477+
"unregisterSearchCommand": [MockFunction],
24762478
},
24772479
"logos": Object {
24782480
"AnimatedMark": Object {

public/components/application_analytics/components/flyout_components/trace_detail_render.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const TraceDetailRender = ({
5151
const renderContent = useMemo(() => {
5252
if (!traceId) return <></>;
5353
const overviewList = [
54-
getListItem('Trace ID', traceId),
54+
getListItem('Trace Id', traceId),
5555
getListItem('Trace group name', fields.trace_group || '-'),
5656
getListItem('Latency', fields.latency),
5757
getListItem('Last updated', fields.last_updated),

public/components/custom_panels/__tests__/__snapshots__/custom_panel_view.test.tsx.snap

+4
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,7 @@ exports[`Panels View Component renders panel view container with visualizations
11691169
"getIsVisible$": [MockFunction],
11701170
"globalSearch": Object {
11711171
"getAllSearchCommands": [MockFunction],
1172+
"unregisterSearchCommand": [MockFunction],
11721173
},
11731174
"logos": Object {
11741175
"AnimatedMark": Object {
@@ -3078,6 +3079,7 @@ exports[`Panels View Component renders panel view container with visualizations
30783079
"getIsVisible$": [MockFunction],
30793080
"globalSearch": Object {
30803081
"getAllSearchCommands": [MockFunction],
3082+
"unregisterSearchCommand": [MockFunction],
30813083
},
30823084
"logos": Object {
30833085
"AnimatedMark": Object {
@@ -3541,6 +3543,7 @@ exports[`Panels View Component renders panel view container without visualizatio
35413543
"getIsVisible$": [MockFunction],
35423544
"globalSearch": Object {
35433545
"getAllSearchCommands": [MockFunction],
3546+
"unregisterSearchCommand": [MockFunction],
35443547
},
35453548
"logos": Object {
35463549
"AnimatedMark": Object {
@@ -5334,6 +5337,7 @@ exports[`Panels View Component renders panel view container without visualizatio
53345337
"getIsVisible$": [MockFunction],
53355338
"globalSearch": Object {
53365339
"getAllSearchCommands": [MockFunction],
5340+
"unregisterSearchCommand": [MockFunction],
53375341
},
53385342
"logos": Object {
53395343
"AnimatedMark": Object {

public/components/custom_panels/panel_modules/panel_grid/__tests__/__snapshots__/panel_grid.test.tsx.snap

+1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ exports[`Panel Grid Component renders panel grid component with empty visualizat
179179
"getIsVisible$": [MockFunction],
180180
"globalSearch": Object {
181181
"getAllSearchCommands": [MockFunction],
182+
"unregisterSearchCommand": [MockFunction],
182183
},
183184
"logos": Object {
184185
"AnimatedMark": Object {

public/components/metrics/view/__tests__/__snapshots__/metrics_grid.test.tsx.snap

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = `
3232
"getIsVisible$": [MockFunction],
3333
"globalSearch": Object {
3434
"getAllSearchCommands": [MockFunction],
35+
"unregisterSearchCommand": [MockFunction],
3536
},
3637
"logos": Object {
3738
"AnimatedMark": Object {
@@ -211,6 +212,7 @@ exports[`Metrics Grid Component renders Metrics Grid Component 1`] = `
211212
"getIsVisible$": [MockFunction],
212213
"globalSearch": Object {
213214
"getAllSearchCommands": [MockFunction],
215+
"unregisterSearchCommand": [MockFunction],
214216
},
215217
"logos": Object {
216218
"AnimatedMark": Object {

public/components/notebooks/components/paragraph_components/__tests__/__snapshots__/paragraphs.test.tsx.snap

+4-33
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,7 @@ exports[`<Paragraphs /> spec renders the component 1`] = `
156156
rel="noopener noreferrer"
157157
target="_blank"
158158
>
159-
160-
SQL
161-
<svg
162-
aria-hidden="true"
163-
class="euiIcon euiIcon--small euiIcon-isLoading"
164-
focusable="false"
165-
height="16"
166-
role="img"
167-
viewBox="0 0 16 16"
168-
width="16"
169-
xmlns="http://www.w3.org/2000/svg"
170-
>
171-
<path
172-
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
173-
/>
174-
</svg>
175-
159+
SQL
176160
<svg
177161
aria-hidden="true"
178162
aria-label="External link"
@@ -194,29 +178,15 @@ exports[`<Paragraphs /> spec renders the component 1`] = `
194178
(opens in a new tab or window)
195179
</span>
196180
</a>
181+
197182
and
198183
<a
199184
class="euiLink euiLink--primary"
200185
href="https://opensearch.org/docs/latest/search-plugins/sql/ppl/index"
201186
rel="noopener noreferrer"
202187
target="_blank"
203188
>
204-
205-
PPL
206-
<svg
207-
aria-hidden="true"
208-
class="euiIcon euiIcon--small euiIcon-isLoading"
209-
focusable="false"
210-
height="16"
211-
role="img"
212-
viewBox="0 0 16 16"
213-
width="16"
214-
xmlns="http://www.w3.org/2000/svg"
215-
>
216-
<path
217-
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
218-
/>
219-
</svg>
189+
PPL
220190
<svg
221191
aria-hidden="true"
222192
aria-label="External link"
@@ -238,6 +208,7 @@ exports[`<Paragraphs /> spec renders the component 1`] = `
238208
(opens in a new tab or window)
239209
</span>
240210
</a>
211+
241212
.
242213
</div>
243214
</div>

0 commit comments

Comments
 (0)