Skip to content

Commit ac5dca1

Browse files
authored
[scout] use global setting api to disable solution tour on ECH (elastic#250174)
## Summary Since we have `kbnClient.updateGlobal` to update Kibana UI Settings globally for all the spaces, this PR moves the logic from tests directly into `kbn/scout` I also update Profiling tests to pass on ECH (still in question why numbers are 2x)
1 parent 799a2ac commit ac5dca1

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/worker/core_fixtures.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ export const coreWorkerFixtures = base.extend<{}, CoreWorkerFixtures>({
257257
// it from interfering with test flows
258258
await kbnClient.uiSettings.updateGlobal({ hideAnnouncements: true });
259259

260+
// disable solution tour on ECH
261+
if (config.isCloud && !config.serverless) {
262+
log.info('Disabling Space Solution Tour globally on ECH deployment');
263+
await kbnClient.uiSettings.updateGlobal({ showSpaceSolutionTour: false });
264+
}
265+
260266
await use({
261267
session,
262268
customRoleName,

x-pack/solutions/observability/plugins/apm/test/scout/ui/parallel_tests/global.setup.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,8 @@ globalSetupHook.setTimeout(2 * 60 * 1000); // 2 minutes
2222
globalSetupHook(
2323
'Ingest data to Elasticsearch',
2424
{ tag: ['@ess', '@svlOblt'] },
25-
async ({ apmSynthtraceEsClient, apiServices, log, config, esClient, kbnClient }) => {
25+
async ({ apmSynthtraceEsClient, apiServices, log, config, esClient }) => {
2626
const startTime = Date.now();
27-
28-
// disable solution tour on ECH
29-
if (config.isCloud && !config.serverless) {
30-
await kbnClient.uiSettings.update({ showSpaceSolutionTour: false });
31-
}
3227
if (!config.isCloud) {
3328
await apiServices.fleet.internal.setup();
3429
log.info('Fleet infrastructure setup completed');

x-pack/solutions/observability/plugins/profiling/test/scout/ui/parallel_tests/storage_explorer/storage_explorer.spec.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ test.describe('Storage explorer page', { tag: ['@ess'] }, () => {
6161

6262
test('Data breakdown tab displays correct values per index', async ({
6363
pageObjects: { profilingStorageExplorerPage },
64+
config,
6465
}) => {
6566
await profilingStorageExplorerPage.gotoWithTimeRange(rangeFrom, rangeTo);
6667

@@ -75,6 +76,14 @@ test.describe('Storage explorer page', { tag: ['@ess'] }, () => {
7576
{ indexName: 'events', docSize: '3,242' },
7677
];
7778

79+
// eslint-disable-next-line playwright/no-conditional-in-test
80+
const expectedData = config.isCloud
81+
? indexData.map((data) => ({
82+
...data,
83+
docSize: (parseInt(data.docSize.replace(/,/g, ''), 10) * 2).toLocaleString(),
84+
}))
85+
: indexData;
86+
7887
// Cloud ECH data
7988
// TODO check why it is different: https://github.com/elastic/kibana/issues/241822
8089
// const indexData = [
@@ -84,7 +93,7 @@ test.describe('Storage explorer page', { tag: ['@ess'] }, () => {
8493
// { indexName: 'metrics', docSize: '0' },
8594
// { indexName: 'events', docSize: '6,484' },
8695
// ];
87-
for (const { indexName, docSize } of indexData) {
96+
for (const { indexName, docSize } of expectedData) {
8897
await expect(
8998
profilingStorageExplorerPage.page.getByTestId(`${indexName}_docSize`)
9099
).toContainText(docSize);

x-pack/solutions/observability/plugins/slo/test/scout/ui/tests/global.setup.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ import { globalSetupHook } from '@kbn/scout-oblt';
1010
globalSetupHook(
1111
'Setup environment for SLO tests',
1212
{ tag: ['@ess', '@svlOblt'] },
13-
async ({ kbnClient, log, config, sloData }) => {
13+
async ({ sloData }) => {
1414
await sloData.generateSloData();
1515
await sloData.addSLO();
16-
log.debug('[setup] Disabling solution tour...');
17-
if (config.isCloud && !config.serverless) {
18-
await kbnClient.uiSettings.update({ showSpaceSolutionTour: false });
19-
}
2016
}
2117
);

0 commit comments

Comments
 (0)