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.
[ML] Functional tests - add basic license tests (elastic#82147)
This PR adds initial functional tests and api integration tests running on a basic license for the ML and Transform apps.
- Loading branch information
Showing
29 changed files
with
838 additions
and
48 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
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; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('apis', function () { | ||
this.tags('ciGroup2'); | ||
|
||
loadTestFile(require.resolve('./ml')); | ||
loadTestFile(require.resolve('./transform')); | ||
}); | ||
} |
14 changes: 14 additions & 0 deletions
14
x-pack/test/api_integration_basic/apis/ml/data_visualizer/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,14 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('data visualizer', function () { | ||
// The data visualizer APIs should work the same as with a trial license | ||
loadTestFile(require.resolve('../../../../api_integration/apis/ml/data_visualizer')); | ||
}); | ||
} |
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,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ getService, loadTestFile }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const ml = getService('ml'); | ||
|
||
describe('machine learning basic license', function () { | ||
this.tags(['mlqa']); | ||
|
||
before(async () => { | ||
await ml.securityCommon.createMlRoles(); | ||
await ml.securityCommon.createMlUsers(); | ||
}); | ||
|
||
after(async () => { | ||
await ml.securityCommon.cleanMlUsers(); | ||
await ml.securityCommon.cleanMlRoles(); | ||
|
||
await ml.testResources.deleteIndexPatternByTitle('ft_farequote'); | ||
|
||
await esArchiver.unload('ml/farequote'); | ||
|
||
await ml.testResources.resetKibanaTimeZone(); | ||
}); | ||
|
||
loadTestFile(require.resolve('./data_visualizer')); | ||
}); | ||
} |
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; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('transform basic license', function () { | ||
this.tags(['transform']); | ||
|
||
// The transform UI should work the same as with a trial license | ||
loadTestFile(require.resolve('../../../api_integration/apis/transform')); | ||
}); | ||
} |
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,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const xpackApiIntegrationConfig = await readConfigFile( | ||
require.resolve('../api_integration/config.ts') | ||
); | ||
|
||
return { | ||
// default to the xpack api integration config | ||
...xpackApiIntegrationConfig.getAll(), | ||
esTestCluster: { | ||
...xpackApiIntegrationConfig.get('esTestCluster'), | ||
license: 'basic', | ||
serverArgs: [ | ||
'xpack.license.self_generated.type=basic', | ||
'xpack.security.enabled=true', | ||
'xpack.security.authc.api_key.enabled=true', | ||
], | ||
}, | ||
testFiles: [require.resolve('./apis')], | ||
junit: { | ||
...xpackApiIntegrationConfig.get('junit'), | ||
reportName: 'Chrome X-Pack UI Functional Tests Basic License', | ||
}, | ||
}; | ||
} |
11 changes: 11 additions & 0 deletions
11
x-pack/test/api_integration_basic/ftr_provider_context.d.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,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { GenericFtrProviderContext } from '@kbn/test/types/ftr'; | ||
|
||
import { services } from '../api_integration/services'; | ||
|
||
export type FtrProviderContext = GenericFtrProviderContext<typeof services, {}>; |
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
62 changes: 62 additions & 0 deletions
62
x-pack/test/functional/apps/ml/data_visualizer/index_data_visualizer_actions_panel.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,62 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
export default function ({ getService }: FtrProviderContext) { | ||
const esArchiver = getService('esArchiver'); | ||
const ml = getService('ml'); | ||
|
||
describe('index based actions panel', function () { | ||
this.tags(['mlqa']); | ||
|
||
const indexPatternName = 'ft_farequote'; | ||
const advancedJobWizardDatafeedQuery = `{ | ||
"bool": { | ||
"must": [ | ||
{ | ||
"match_all": {} | ||
} | ||
] | ||
} | ||
}`; // Note query is not currently passed to the wizard | ||
|
||
before(async () => { | ||
await esArchiver.loadIfNeeded('ml/farequote'); | ||
await ml.testResources.createIndexPatternIfNeeded(indexPatternName, '@timestamp'); | ||
await ml.testResources.setKibanaTimeZoneToUTC(); | ||
|
||
await ml.securityUI.loginAsMlPowerUser(); | ||
}); | ||
|
||
describe('create advanced job action', function () { | ||
it('loads the source data in the data visualizer', async () => { | ||
await ml.testExecution.logTestStep('loads the data visualizer selector page'); | ||
await ml.navigation.navigateToMl(); | ||
await ml.navigation.navigateToDataVisualizer(); | ||
|
||
await ml.testExecution.logTestStep('loads the saved search selection page'); | ||
await ml.dataVisualizer.navigateToIndexPatternSelection(); | ||
|
||
await ml.testExecution.logTestStep('loads the index data visualizer page'); | ||
await ml.jobSourceSelection.selectSourceForIndexBasedDataVisualizer(indexPatternName); | ||
}); | ||
|
||
it('opens the advanced job wizard', async () => { | ||
await ml.testExecution.logTestStep('displays the actions panel with advanced job card'); | ||
await ml.dataVisualizerIndexBased.assertActionsPanelExists(); | ||
await ml.dataVisualizerIndexBased.assertCreateAdvancedJobCardExists(); | ||
|
||
// Note the search is not currently passed to the wizard, just the index. | ||
await ml.testExecution.logTestStep('displays the actions panel with advanced job card'); | ||
await ml.dataVisualizerIndexBased.clickCreateAdvancedJobButton(); | ||
await ml.jobTypeSelection.assertAdvancedJobWizardOpen(); | ||
await ml.jobWizardAdvanced.assertDatafeedQueryEditorExists(); | ||
await ml.jobWizardAdvanced.assertDatafeedQueryEditorValue(advancedJobWizardDatafeedQuery); | ||
}); | ||
}); | ||
}); | ||
} |
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
Oops, something went wrong.