-
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.
[FTR] Move serverless tests depending on feature flag to its own conf…
…ig file (#163929) ## Summary It seems beneficial to have feature flag tests in a separate test config file - tests are still run on Kibana CI automatically - tests are not run on MKI projects automatically, but you can deploy custom project and run tests via feature flags config All the feature flags within the same project should be places in the same config to make sure there is no arguments conflict. When the flag is moved to the yml configuration, we can rely on Kibana CI and manually triggered deployment to make sure projects are functioning correctly. --------- Co-authored-by: Robert Oskamp <[email protected]>
- Loading branch information
1 parent
546a3cb
commit 7ece4e5
Showing
40 changed files
with
469 additions
and
304 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 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
52 changes: 52 additions & 0 deletions
52
x-pack/test_serverless/api_integration/services/data_view_api.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,52 @@ | ||
/* | ||
* 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 '../ftr_provider_context'; | ||
|
||
export function DataViewApiProvider({ getService }: FtrProviderContext) { | ||
const supertest = getService('supertest'); | ||
|
||
return { | ||
async create({ id, name, title }: { id: string; name: string; title: string }) { | ||
const { body } = await supertest | ||
.post(`/api/content_management/rpc/create`) | ||
.set('kbn-xsrf', 'foo') | ||
.set('x-elastic-internal-origin', 'foo') | ||
.send({ | ||
contentTypeId: 'index-pattern', | ||
data: { | ||
fieldAttrs: '{}', | ||
title, | ||
timeFieldName: '@timestamp', | ||
sourceFilters: '[]', | ||
fields: '[]', | ||
fieldFormatMap: '{}', | ||
typeMeta: '{}', | ||
runtimeFieldMap: '{}', | ||
name, | ||
}, | ||
options: { id }, | ||
version: 1, | ||
}); | ||
return body; | ||
}, | ||
|
||
async delete({ id }: { id: string }) { | ||
const { body } = await supertest | ||
.post(`/api/content_management/rpc/delete`) | ||
.set('kbn-xsrf', 'foo') | ||
.set('x-elastic-internal-origin', 'foo') | ||
.send({ | ||
contentTypeId: 'index-pattern', | ||
id, | ||
options: { force: true }, | ||
version: 1, | ||
}); | ||
return body; | ||
}, | ||
}; | ||
} |
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
16 changes: 16 additions & 0 deletions
16
x-pack/test_serverless/api_integration/test_suites/observability/cases/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,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 { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('Cases', function () { | ||
loadTestFile(require.resolve('./get_case')); | ||
loadTestFile(require.resolve('./find_cases')); | ||
loadTestFile(require.resolve('./post_case')); | ||
}); | ||
} |
26 changes: 26 additions & 0 deletions
26
x-pack/test_serverless/api_integration/test_suites/observability/config.feature_flags.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,26 @@ | ||
/* | ||
* 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 '../../config.base'; | ||
import { services } from './apm_api_integration/common/services'; | ||
|
||
/** | ||
* Make sure to create a MKI deployment with custom Kibana image, that includes feature flags arguments | ||
* This tests most likely will fail on default MKI project | ||
*/ | ||
export default createTestConfig({ | ||
serverlessProject: 'oblt', | ||
junit: { | ||
reportName: 'Serverless Observability Feature Flags API Integration Tests', | ||
}, | ||
suiteTags: { exclude: ['skipSvlOblt'] }, | ||
services, | ||
// add feature flags | ||
kbnServerArgs: ['--xpack.observability.unsafe.thresholdRule.enabled=true'], | ||
// load tests in the index file | ||
testFiles: [require.resolve('./index.feature_flags.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
71 changes: 0 additions & 71 deletions
71
.../test_serverless/api_integration/test_suites/observability/helpers/alerting_api_helper.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.