-
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
FTR: enable ESLint mocha rules for api integration tests #191267
Changes from all commits
6ee0020
b806b14
2bed553
3b98c57
ffe6cf4
32066d3
6e23c4c
cfb1f0b
3705654
5096866
3ba8d41
01e0a6c
4f802ed
3533eb2
696e9e6
4a06190
c7889ab
40d8908
19510e2
835d737
3faef29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ import type { ToolingLog } from '@kbn/tooling-log'; | |
* Example usage: | ||
* ```ts | ||
const fleetResponse = await retry<InstallPackageResponse>({ | ||
test: async () => { | ||
testFn: async () => { | ||
const testResponse = await supertest | ||
.post(`/api/fleet/epm/packages/security_detection_engine`) | ||
.set('kbn-xsrf', 'xxxx') | ||
|
@@ -45,15 +45,15 @@ import type { ToolingLog } from '@kbn/tooling-log'; | |
* @returns The response from the test | ||
*/ | ||
export const retry = async <T>({ | ||
test, | ||
testFn, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
retryService, | ||
utilityName, | ||
retries = 3, | ||
timeout = 30000, | ||
retryDelay = 200, | ||
logger, | ||
}: { | ||
test: () => Promise<T>; | ||
testFn: () => Promise<T>; | ||
utilityName: string; | ||
retryService: RetryService; | ||
retries?: number; | ||
|
@@ -77,7 +77,7 @@ export const retry = async <T>({ | |
|
||
retryAttempt = retryAttempt + 1; | ||
|
||
return await test(); | ||
return await testFn(); | ||
}, | ||
undefined, | ||
retryDelay | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -28,8 +28,6 @@ export default function ({ getService }: FtrProviderContext) { | |||||||||||||||||
}, | ||||||||||||||||||
}; | ||||||||||||||||||
|
||||||||||||||||||
after(async () => await deleteAllIndices()); | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicate hook: kibana/x-pack/test/api_integration/apis/management/index_management/mapping.ts Lines 41 to 48 in 3b98c57
|
||||||||||||||||||
|
||||||||||||||||||
before(async () => { | ||||||||||||||||||
log.debug('Creating index'); | ||||||||||||||||||
try { | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,14 @@ export default function ({ getService }: FtrProviderContext) { | |
const kibanaServer = getService('kibanaServer'); | ||
|
||
describe('sources', () => { | ||
before(() => esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs')); | ||
after(() => esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs')); | ||
before(() => kibanaServer.savedObjects.cleanStandardList()); | ||
after(() => kibanaServer.savedObjects.cleanStandardList()); | ||
before(async () => { | ||
await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); | ||
await kibanaServer.savedObjects.cleanStandardList(); | ||
}); | ||
after(async () => { | ||
await esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs'); | ||
await kibanaServer.savedObjects.cleanStandardList(); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Duplicating hooks is not recommended because it can lead to confusion about the order of execution and potential issues in test maintenance. |
||
|
||
const patchRequest = async ( | ||
body: PartialMetricsSourceConfigurationProperties | ||
|
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.
Complete duplicate of
kibana/test/api_integration/apis/data_views/scripted_fields_crud/get_scripted_field/errors.ts
Lines 51 to 57 in 2bed553
in the same file