Skip to content
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

[7.x] Add Upgrade Assistant API integration test to ensure the reindex operation saved object can handle immense error messages (#72347) #72645

Merged
merged 1 commit into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions x-pack/test/api_integration/apis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ export default function ({ loadTestFile }) {
loadTestFile(require.resolve('./endpoint'));
loadTestFile(require.resolve('./ingest_manager'));
loadTestFile(require.resolve('./lists'));
loadTestFile(require.resolve('./upgrade_assistant'));
});
}
13 changes: 13 additions & 0 deletions x-pack/test/api_integration/apis/upgrade_assistant/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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('Upgrade Assistant', () => {
loadTestFile(require.resolve('./upgrade_assistant'));
});
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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 expect from '@kbn/expect';

import { FtrProviderContext } from '../../ftr_provider_context';
import { reindexOperationWithLargeErrorMessage } from './reindex_operation_with_large_error_message';

export default function ({ getService }: FtrProviderContext) {
const es = getService('legacyEs');

describe('Reindex operation saved object', function () {
const dotKibanaIndex = '.kibana';
const fakeSavedObjectId = 'fakeSavedObjectId';

after(async () => {
// Clean up the fake saved object we created. This will error if the test failed.
return await es.delete({ index: dotKibanaIndex, id: fakeSavedObjectId });
});

it('is indexed successfully with immense error message', async () => {
// Guards against regression of https://github.com/elastic/kibana/pull/71710.
const result = await es.create({
index: dotKibanaIndex, // In normal operation this would be the .kibana-n index.
id: fakeSavedObjectId,
body: reindexOperationWithLargeErrorMessage,
});
expect(result).to.be.ok();
});
});
}