-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OTel K8S e2e test for Ensemble (#206756)
This adds an e2e test for [the Ensemble workflow](https://github.com/elastic/ensemble/actions/workflows/nightly.yml) to cover stack installation part of the OTel K8S quickstart flow. Besides that I've replaced the retry logic for K8S EA and Auto Detect flow with a simple timeouts to workaround the missing data issue on the CTA pages (host details and k8s dashboard) after finishing the onboarding flow. I've also simplified assertions on the CTA pages.
- Loading branch information
1 parent
cd71ca9
commit ad30ed8
Showing
11 changed files
with
230 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...vability/plugins/observability_onboarding/e2e/playwright/stateful/kubernetes_otel.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import { test } from './fixtures/base_page'; | ||
import { assertEnv } from '../lib/assert_env'; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto(`${process.env.KIBANA_BASE_URL}/app/observabilityOnboarding`); | ||
}); | ||
|
||
test('Otel Kubernetes', async ({ | ||
page, | ||
onboardingHomePage, | ||
otelKubernetesFlowPage, | ||
otelKubernetesOverviewDashboardPage, | ||
}) => { | ||
assertEnv(process.env.ARTIFACTS_FOLDER, 'ARTIFACTS_FOLDER is not defined.'); | ||
|
||
const fileName = 'code_snippet_otel_kubernetes.sh'; | ||
const outputPath = path.join(__dirname, '..', process.env.ARTIFACTS_FOLDER, fileName); | ||
|
||
await onboardingHomePage.selectKubernetesUseCase(); | ||
await onboardingHomePage.selectOtelKubernetesQuickstart(); | ||
|
||
await otelKubernetesFlowPage.copyHelmRepositorySnippetToClipboard(); | ||
const helmRepoSnippet = (await page.evaluate('navigator.clipboard.readText()')) as string; | ||
|
||
await otelKubernetesFlowPage.copyInstallStackSnippetToClipboard(); | ||
const installStackSnippet = (await page.evaluate('navigator.clipboard.readText()')) as string; | ||
|
||
const codeSnippet = `${helmRepoSnippet}\n${installStackSnippet}`; | ||
|
||
/** | ||
* Ensemble story watches for the code snippet file | ||
* to be created and then executes it | ||
*/ | ||
fs.writeFileSync(outputPath, codeSnippet); | ||
|
||
/** | ||
* There is no explicit data ingest indication | ||
* in the flow, so we need to rely on a timeout. | ||
* 3 minutes should be enough for the stack to be | ||
* created and to start pushing data. | ||
*/ | ||
await page.waitForTimeout(3 * 60000); | ||
|
||
await otelKubernetesFlowPage.clickClusterOverviewDashboardCTA(); | ||
await otelKubernetesOverviewDashboardPage.assertNodesPanelNotEmpty(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.