Skip to content

Commit

Permalink
[ILM] Fixed failed functional tests on Cloud (elastic#123202)
Browse files Browse the repository at this point in the history
* [ILM] Fixed functional test failures on Cloud

* [Upgrade Assistant] Fixed functional test failures on Cloud
  • Loading branch information
yuliacech committed Jan 18, 2022
1 parent e721b2b commit a62a6f3
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions x-pack/test/functional/apps/index_lifecycle_management/home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,41 @@ import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';

const policyName = 'testPolicy1';
const repoName = 'test';
const repoName = 'found-snapshots'; // this repo already exists on cloud

export default ({ getPageObjects, getService }: FtrProviderContext) => {
const pageObjects = getPageObjects(['common', 'indexLifecycleManagement']);
const log = getService('log');
const retry = getService('retry');
const esClient = getService('es');
const security = getService('security');
const deployment = getService('deployment');

describe('Home page', function () {
before(async () => {
await security.testUser.setRoles(['manage_ilm'], true);
await esClient.snapshot.createRepository({
name: repoName,
body: {
type: 'fs',
settings: {
// use one of the values defined in path.repo in test/functional/config.js
location: '/tmp/',
const isCloud = await deployment.isCloud();
if (!isCloud) {
await esClient.snapshot.createRepository({
name: repoName,
body: {
type: 'fs',
settings: {
// use one of the values defined in path.repo in test/functional/config.js
location: '/tmp/',
},
},
},
verify: false,
});
verify: false,
});
}

await pageObjects.common.navigateToApp('indexLifecycleManagement');
});
after(async () => {
await esClient.snapshot.deleteRepository({ name: repoName });
const isCloud = await deployment.isCloud();
if (!isCloud) {
await esClient.snapshot.deleteRepository({ name: repoName });
}
await esClient.ilm.deleteLifecycle({ name: policyName });
await security.testUser.restoreDefaults();
});
Expand Down

0 comments on commit a62a6f3

Please sign in to comment.