-
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
[Custom threshold] Add an adHoc data view API integration test #171508
[Custom threshold] Add an adHoc data view API integration test #171508
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
@@ -64,5 +64,8 @@ export async function createRule<Params = ThresholdParams>({ | |||
rule_type_id: ruleTypeId, | |||
actions, | |||
}); | |||
if (body.statusCode && body.statusCode !== 200) { | |||
throw new Error(body.message); |
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.
In case of an error, the message was not visible in logs, so I added this condition to surface the error message.
const MOCKED_AD_HOC_DATA_VIEW = { | ||
id: DATA_VIEW_ID, | ||
title: DATE_VIEW, | ||
timeFieldName: '@timestamp', | ||
sourceFilters: [], | ||
fieldFormats: {}, | ||
runtimeFieldMap: {}, | ||
allowNoIndex: false, | ||
name: DATE_VIEW_NAME, | ||
allowHidden: false, | ||
}; |
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.
might be worth using this util from data plugin createStubDataView
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.
x-pack/test/alerting_api_integration/observability/helpers/alerting_api_helper.ts
Outdated
Show resolved
Hide resolved
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.
Generally looks good, provided two suggestions !!
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Closes #170438
Summary
This PR adds an ad hoc data view API integration test by changing one of the existing custom threshold API integration tests.