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.
[Security Solution][Detection Engine] ML Cypress Improvements (elasti…
…c#186831) ## Summary This PR contains a collection of fixes, mainly cherry-picked from elastic#181926. Since some of these tests are failing sporadically on main, I'm opening this "test fix" PR for expedience while elastic#181926 is still in review. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed * [Cypress * 100](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6385) * [Serverless Cypress * 100](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6386)
- Loading branch information
Showing
5 changed files
with
67 additions
and
22 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
28 changes: 28 additions & 0 deletions
28
x-pack/test/security_solution_cypress/cypress/support/machine_learning.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,28 @@ | ||
/* | ||
* 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 { rootRequest } from '../tasks/api_calls/common'; | ||
|
||
/** | ||
* Calls the internal ML Jobs API to force stop the datafeed of, and force close | ||
* the job with the given ID. | ||
* | ||
* @param jobId the ID of the ML job to stop and close | ||
* @returns the response from the force stop and close job request | ||
*/ | ||
export const forceStopAndCloseJob = ({ jobId }: { jobId: string }) => | ||
rootRequest({ | ||
headers: { | ||
'elastic-api-version': 1, | ||
}, | ||
method: 'POST', | ||
url: '/internal/ml/jobs/force_stop_and_close_job', | ||
failOnStatusCode: false, | ||
body: { | ||
jobId, | ||
}, | ||
}); |
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