forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[scout] add ci pipeline (elastic#202707)
## Summary Adding basic pipeline to run scout UI tests for stateful and 3 serverless projects. Few tests were skipped for Security project because esArchives used in tests ingest index that are restricted for default project roles. It is an opt-in pipeline to verify kbn/scout changes does not break the existing tests. It is only for start and we plan to re-work into a mature pipeline later. New opt-in [pipeline](https://buildkite.com/elastic/kibana-pull-request/builds/258589#0193afc4-bbd6-4200-8c5f-a7e4a8073e1d) was added <img width="1659" alt="Screenshot 2024-12-10 at 11 31 35" src="https://github.com/user-attachments/assets/1c19fa46-4e66-4796-ac6d-c2c96c74fa8e">
- Loading branch information
1 parent
41afd58
commit 2f3df91
Showing
21 changed files
with
312 additions
and
158 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
steps: | ||
- command: .buildkite/scripts/steps/functional/scout_ui_tests.sh | ||
label: 'Scout UI Tests' | ||
agents: | ||
machineType: n2-standard-4 | ||
preemptible: true | ||
depends_on: | ||
- build | ||
- quick_checks | ||
- checks | ||
- linting | ||
- linting_with_types | ||
- check_types | ||
timeout_in_minutes: 30 | ||
retry: | ||
automatic: | ||
- exit_status: '-1' | ||
limit: 2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
source .buildkite/scripts/steps/functional/common.sh | ||
|
||
export JOB=kibana-scout-ui-tests | ||
|
||
TEST_CONFIG="x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts" | ||
KIBANA_DIR="$KIBANA_BUILD_LOCATION" | ||
|
||
declare -A TESTS=( | ||
["Stateful"]="--stateful" | ||
["Serverless Elasticsearch"]="--serverless=es" | ||
["Serverless Observability"]="--serverless=oblt" | ||
["Serverless Security"]="--serverless=security" | ||
) | ||
|
||
ORDER=("Stateful" "Serverless Elasticsearch" "Serverless Observability" "Serverless Security") | ||
|
||
EXIT_CODE=0 | ||
|
||
for TEST_NAME in "${ORDER[@]}"; do | ||
RUN_MODE="${TESTS[$TEST_NAME]}" | ||
echo "--- $TEST_NAME: 'discover_enhanced' plugin UI Tests" | ||
if ! node scripts/scout run-tests "$RUN_MODE" --config "$TEST_CONFIG" --kibana-install-dir "$KIBANA_DIR"; then | ||
echo "$TEST_NAME: failed" | ||
EXIT_CODE=1 | ||
else | ||
echo "$TEST_NAME: passed" | ||
fi | ||
done | ||
|
||
exit $EXIT_CODE |
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
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
35 changes: 35 additions & 0 deletions
35
packages/kbn-scout/src/playwright/fixtures/test/validate_tags.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,35 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { test as base } from '@playwright/test'; | ||
import { tags } from '../../tags'; | ||
|
||
const supportedTags = tags.DEPLOYMENT_AGNOSTIC; | ||
|
||
export const validateTagsFixture = base.extend<{ validateTags: void }>({ | ||
validateTags: [ | ||
async ({}, use, testInfo) => { | ||
if (testInfo.tags.length === 0) { | ||
throw new Error(`At least one tag is required: ${supportedTags.join(', ')}`); | ||
} | ||
|
||
const invalidTags = testInfo.tags.filter((tag: string) => !supportedTags.includes(tag)); | ||
if (invalidTags.length > 0) { | ||
throw new Error( | ||
`Unsupported tag(s) found in test suite "${testInfo.title}": ${invalidTags.join( | ||
', ' | ||
)}. ` + `Supported tags are: ${supportedTags.join(', ')}.` | ||
); | ||
} | ||
|
||
await use(); | ||
}, | ||
{ auto: true }, | ||
], | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 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", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
const SERVERLESS_ONLY = ['@svlSecurity', '@svlOblt', '@svlSearch']; | ||
const ESS_ONLY = ['@ess']; | ||
const DEPLOYMENT_AGNOSTIC = SERVERLESS_ONLY.concat(ESS_ONLY); | ||
|
||
export const tags = { | ||
ESS_ONLY, | ||
SERVERLESS_ONLY, | ||
DEPLOYMENT_AGNOSTIC, | ||
}; | ||
|
||
export const tagsByMode = { | ||
stateful: '@ess', | ||
serverless: { | ||
es: '@svlSearch', | ||
oblt: '@svlOblt', | ||
security: '@svlSecurity', | ||
}, | ||
}; |
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.