-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[scout] add ci pipeline #202707
[scout] add ci pipeline #202707
Conversation
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 }, | ||
], | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal: notify test author about requirement of tags definition and validating its correctness. I also introduces aliases through tags
variable to minimize spelling error.
Note: it only work when you run tests in IDE; when you run tests via npx playwright test --grep <tag>
playwright is doing filtering in advance and no tags or incorrect tags will cause test to be filtered out.
That said, for CI we will need to come up with some script to validate tags being defined. But I still believe there is a benefit of raising error during test development process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { test, testData } from '../fixtures'; | ||
|
||
test.describe('Discover app - errors', { tag: ['@ess'] }, () => { | ||
test.describe('Discover app - errors', { tag: tags.ESS_ONLY }, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alias to simplify the process and avoid spelling/incorrect tagging issues
}; | ||
|
||
test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { | ||
await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.ECOMMERCE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will work for Security project only with admin
role, that has access to all indexes. It probably means generating new saved objects, leaving for later
{ tag: ['@ess', '@svlSecurity', '@svlOblt', '@svlSearch'] }, | ||
{ tag: ['@ess', '@svlSearch', '@svlOblt'] }, | ||
// TODO: Update to use an ES archive with an index accessible to 'viewer' | ||
// for running this test against the Security serverless project. | ||
() => { | ||
test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { | ||
await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.NO_TIME_FIELD); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar issue: viewer
has access to limited indexes ( '.siem-signals*', '.lists-', '.items-') and test requires re-work.
args: [ | ||
'test', | ||
`--config=${playwrightConfigPath}`, | ||
`--grep=${playwrightGrepTag}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing one of @ess
, svlSearch
, ... tags to playwright runner
'--xpack.cloud.profile_url=/user/settings/', | ||
'--xpack.cloud.projects_url=/projects/', | ||
'--xpack.cloud.serverless.project_id=fakeprojectid', | ||
'--xpack.cloud.users_and_roles_url=/account/members/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied missing arguments from FTR svl config
/^x-pack\/plugins\/discover_enhanced\/ui_tests/, | ||
/^packages\/kbn-scout/, | ||
])) || | ||
GITHUB_PR_LABELS.includes('ci:scout-ui-tests') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ci:scout-ui-tests
, later we can add ci:scout-api-tests
, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perused over the changes and nothing looks out of place to me, but someone more experienced in this code base should approve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have a few things in mind that we should discuss and potentially follow up on. But in the interest of moving forward, we should merge this PR and handle the items in separate PRs.
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
History
cc @dmlemeshko |
## 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">
## 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"> (cherry picked from commit 87b2a12) # Conflicts: # x-pack/plugins/discover_enhanced/ui_tests/tests/saved_searches.spec.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[scout] add ci pipeline (#202707)](#202707) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-11T11:15:50Z","message":"[scout] add ci pipeline (#202707)\n\n## Summary\r\n\r\nAdding basic pipeline to run scout UI tests for stateful and 3\r\nserverless projects. Few tests were skipped for Security project because\r\nesArchives used in tests ingest index that are restricted for default\r\nproject roles.\r\n\r\nIt is an opt-in pipeline to verify kbn/scout changes does not break the\r\nexisting tests. It is only for start and we plan to re-work into a\r\nmature pipeline later.\r\n\r\nNew opt-in\r\n[pipeline](https://buildkite.com/elastic/kibana-pull-request/builds/258589#0193afc4-bbd6-4200-8c5f-a7e4a8073e1d)\r\nwas added\r\n<img width=\"1659\" alt=\"Screenshot 2024-12-10 at 11 31 35\"\r\nsrc=\"https://github.com/user-attachments/assets/1c19fa46-4e66-4796-ac6d-c2c96c74fa8e\">","sha":"87b2a12480c457ecb5ec9640c3e3ebc697edf0f7","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","v9.0.0","test:scout"],"number":202707,"url":"https://github.com/elastic/kibana/pull/202707","mergeCommit":{"message":"[scout] add ci pipeline (#202707)\n\n## Summary\r\n\r\nAdding basic pipeline to run scout UI tests for stateful and 3\r\nserverless projects. Few tests were skipped for Security project because\r\nesArchives used in tests ingest index that are restricted for default\r\nproject roles.\r\n\r\nIt is an opt-in pipeline to verify kbn/scout changes does not break the\r\nexisting tests. It is only for start and we plan to re-work into a\r\nmature pipeline later.\r\n\r\nNew opt-in\r\n[pipeline](https://buildkite.com/elastic/kibana-pull-request/builds/258589#0193afc4-bbd6-4200-8c5f-a7e4a8073e1d)\r\nwas added\r\n<img width=\"1659\" alt=\"Screenshot 2024-12-10 at 11 31 35\"\r\nsrc=\"https://github.com/user-attachments/assets/1c19fa46-4e66-4796-ac6d-c2c96c74fa8e\">","sha":"87b2a12480c457ecb5ec9640c3e3ebc697edf0f7"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202707","number":202707,"mergeCommit":{"message":"[scout] add ci pipeline (#202707)\n\n## Summary\r\n\r\nAdding basic pipeline to run scout UI tests for stateful and 3\r\nserverless projects. Few tests were skipped for Security project because\r\nesArchives used in tests ingest index that are restricted for default\r\nproject roles.\r\n\r\nIt is an opt-in pipeline to verify kbn/scout changes does not break the\r\nexisting tests. It is only for start and we plan to re-work into a\r\nmature pipeline later.\r\n\r\nNew opt-in\r\n[pipeline](https://buildkite.com/elastic/kibana-pull-request/builds/258589#0193afc4-bbd6-4200-8c5f-a7e4a8073e1d)\r\nwas added\r\n<img width=\"1659\" alt=\"Screenshot 2024-12-10 at 11 31 35\"\r\nsrc=\"https://github.com/user-attachments/assets/1c19fa46-4e66-4796-ac6d-c2c96c74fa8e\">","sha":"87b2a12480c457ecb5ec9640c3e3ebc697edf0f7"}}]}] BACKPORT-->
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 was added