-
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
[ML] Add functional tests for Data Drift view #167911
Conversation
2e1e962
to
d441274
Compare
887457f
to
c6642fd
Compare
c6642fd
to
f7b86cb
Compare
Pinging @elastic/ml-ui (:ml) |
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, although looks like one of the flaky test runner failed.
x-pack/test/functional/apps/ml/short_tests/model_management/model_list.ts
Outdated
Show resolved
Hide resolved
The failed test is actually not related to data drift 🤔 Looks like a flaky test, need some more investigation. |
@@ -149,7 +152,9 @@ export const DataDriftOverviewTable = ({ | |||
'data-test-subj': 'mlDataDriftOverviewTableDriftDetected', | |||
sortable: true, | |||
textOnly: true, | |||
render: (driftDetected: boolean) => { | |||
render: (driftDetected: boolean, item) => { | |||
// @ts-expect-error currently ES two_sided does return string NaN, will be fixed |
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.
is there an issue we can mention in the comment?
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.
Valeriy is investigating this and will create an issue on the Elasticsearch side. But for now, we don't have an issue.
); | ||
await ml.dataDrift.assertNoWindowParametersEmptyPromptExists(); | ||
await ml.testExecution.logTestStep( | ||
`${testData.suiteTitle} displays elements in the page correctly` |
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.
`${testData.suiteTitle} displays elements in the page correctly` | |
`${testData.suiteTitle} displays elements on the page correctly` |
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.
Updated here 0ef6b56
(#167911)
const btn = await testSubjects.find('analyzeDataDriftButton'); | ||
const isDisabled = await btn.getAttribute('disabled'); | ||
expect(isDisabled).to.equal(disabled ? 'true' : null); |
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.
const btn = await testSubjects.find('analyzeDataDriftButton'); | |
const isDisabled = await btn.getAttribute('disabled'); | |
expect(isDisabled).to.equal(disabled ? 'true' : null); | |
const isDisabled = !(awaot testSubjects. isEnabled('analyzeDataDriftButton)); | |
expect(isDisabled).to.equal(disabled); |
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.
Updated here 0ef6b56
(#167911)
const btn = await testSubjects.find('analyzeDataDriftWithoutSavingButton'); | ||
const isDisabled = await btn.getAttribute('disabled'); | ||
expect(isDisabled).to.equal(disabled ? 'true' : null); |
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.
const btn = await testSubjects.find('analyzeDataDriftWithoutSavingButton'); | |
const isDisabled = await btn.getAttribute('disabled'); | |
expect(isDisabled).to.equal(disabled ? 'true' : null); | |
const isDisabled = !(await testSubjects.isEnabled('analyzeDataDriftWithoutSavingButton')); | |
expect(isDisabled).to.equal(disabled); |
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.
Updated here 0ef6b56
(#167911)
}); | ||
} | ||
|
||
public async clickAnalyzeDataDriftActionButton(modelId: string) { |
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.
You can utiilze the invokeAction
method from this service instead
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.
invokeAction doesn't seem to account for when button is directly on the row (e.g. when there are <= 2 actions), or is hidden by the context menu (> 2 actions available) 🤔
); | ||
} | ||
|
||
public async assertAnalyzeDataDriftActionButtonEnabled( |
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.
would be great to have a reusable assertRowActionEnabled
method in generic table service
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 agree that we should have a reusable assertRowActionEnabled, but the current generic table service doesn't have concept for a context menu for the actions. That would require a lot of refactoring for the current trained models table & the generic service. I think that's out of scope of this PR.
@elasticmachine merge upstream |
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.
Tested with fix for item 1 in #168090, and LGTM
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @qn895 |
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit f28349f)
💚 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.11`: - [[ML] Add functional tests for Data Drift view (#167911)](#167911) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Quynh Nguyen (Quinn)","email":"43350163+qn895@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-10-12T22:52:25Z","message":"[ML] Add functional tests for Data Drift view (#167911)\n\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"f28349faf19d78bb679918297742a0bf7cb064f5","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","test_ui_functional","release_note:skip","v8.11.0","v8.12.0","v8.11.1"],"number":167911,"url":"https://github.com/elastic/kibana/pull/167911","mergeCommit":{"message":"[ML] Add functional tests for Data Drift view (#167911)\n\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"f28349faf19d78bb679918297742a0bf7cb064f5"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/167911","number":167911,"mergeCommit":{"message":"[ML] Add functional tests for Data Drift view (#167911)\n\nCo-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>","sha":"f28349faf19d78bb679918297742a0bf7cb064f5"}}]}] BACKPORT--> Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR adds functional test for Data drift view. It covers the following scenarios:
Flaky test suite runner... 49/50 passed ✅ - failed test is an unrelated flaky test
PR also fixes:
Checklist