-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moving test to x-pack/test/rule_registry
1 parent
7d8e609
commit 18a2261
Showing
22 changed files
with
163 additions
and
183 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
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
x-pack/test/observability_api_integration/lib/create_alert.ts
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
x-pack/test/observability_api_integration/lib/get_alerts_target_indices.ts
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
25 changes: 25 additions & 0 deletions
25
x-pack/test/rule_registry/common/lib/helpers/create_alert.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,25 @@ | ||
/* | ||
* 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 { User } from '../authentication/types'; | ||
import { GetService, AlertDef } from '../../types'; | ||
import { getSpaceUrlPrefix } from '../authentication/spaces'; | ||
|
||
export const createAlert = async ( | ||
getService: GetService, | ||
user: User, | ||
spaceId: string, | ||
alertDef: AlertDef | ||
) => { | ||
const supertest = getService('supertestWithoutAuth'); | ||
const { body: response, status } = await supertest | ||
.post(`${getSpaceUrlPrefix(spaceId)}/api/alerts/alert`) | ||
.auth(user.username, user.password) | ||
.send(alertDef) | ||
.set('kbn-xsrf', 'foo'); | ||
return { alert: response, status }; | ||
}; |
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
23 changes: 23 additions & 0 deletions
23
x-pack/test/rule_registry/common/lib/helpers/get_alerts_target_indices.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,23 @@ | ||
/* | ||
* 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 { ALERTS_TARGET_INDICES_URL } from '../../constants'; | ||
import { GetService } from '../../types'; | ||
import { User } from '../authentication/types'; | ||
import { getSpaceUrlPrefix } from '../authentication/spaces'; | ||
|
||
export const getAlertsTargetIndices = async ( | ||
getService: GetService, | ||
user: User, | ||
spaceId: string | ||
) => { | ||
const supertest = getService('supertestWithoutAuth'); | ||
return supertest | ||
.get(`${getSpaceUrlPrefix(spaceId)}${ALERTS_TARGET_INDICES_URL}`) | ||
.auth(user.username, user.password) | ||
.send() | ||
.set('kbn-xsrf', 'foo'); | ||
}; |
File renamed without changes.
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,16 @@ | ||
/* | ||
* 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 { createTestConfig } from '../common/config'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default createTestConfig('spaces_only', { | ||
license: 'basic', | ||
disabledPlugins: ['security'], | ||
ssl: false, | ||
testFiles: [require.resolve('./tests/basic')], | ||
}); |
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/rule_registry/spaces_only/tests/basic/index.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 { FtrProviderContext } from '../../../common/ftr_provider_context'; | ||
import { createSpaces, deleteSpaces } from '../../../common/lib/authentication'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default ({ loadTestFile, getService }: FtrProviderContext): void => { | ||
describe('rule registry spaces only: trial', function () { | ||
// Fastest ciGroup for the moment. | ||
this.tags('ciGroup5'); | ||
|
||
before(async () => { | ||
await createSpaces(getService); | ||
}); | ||
|
||
after(async () => { | ||
await deleteSpaces(getService); | ||
}); | ||
|
||
// Basic | ||
loadTestFile(require.resolve('./bootstrap')); | ||
}); | ||
}; |
8 changes: 4 additions & 4 deletions
8
...l/tests/__snapshots__/registry_rules.snap → ...ests/trial/__snapshots__/create_rule.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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