Skip to content

Commit

Permalink
Fix test import objects (#82767)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
Lee Drengenberg and kibanamachine committed Nov 9, 2020
1 parent 9c984f4 commit 1885dda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/functional/apps/management/_import_objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('import objects', function describeIndexTests() {
describe('.ndjson file', () => {
beforeEach(async function () {
// delete .kibana index and then wait for Kibana to re-create it
await kibanaServer.uiSettings.replace({});
await PageObjects.settings.navigateTo();
await esArchiver.load('management');
Expand Down Expand Up @@ -471,16 +470,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
});

it('should display an explicit error message when importing a file bigger than allowed', async () => {
await PageObjects.savedObjects.importFile(
path.join(__dirname, 'exports', '_import_too_big.ndjson')
);
describe('when bigger than savedObjects.maxImportPayloadBytes (not Cloud)', function () {
// see --savedObjects.maxImportPayloadBytes in config file
this.tags(['skipCloud']);
it('should display an explicit error message when importing a file bigger than allowed', async () => {
await PageObjects.savedObjects.importFile(
path.join(__dirname, 'exports', '_import_too_big.ndjson')
);

await PageObjects.savedObjects.checkImportError();
await PageObjects.savedObjects.checkImportError();

const errorText = await PageObjects.savedObjects.getImportErrorText();
const errorText = await PageObjects.savedObjects.getImportErrorText();

expect(errorText).to.contain(`Payload content length greater than maximum allowed`);
expect(errorText).to.contain(`Payload content length greater than maximum allowed`);
});
});

it('should display an explicit error message when importing an invalid file', async () => {
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default async function ({ readConfigFile }) {
'--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions
'--xpack.encryptedSavedObjects.encryptionKey="DkdXazszSCYexXqz4YktBGHCRkV6hyNK"',
'--timelion.ui.enabled=true',
'--savedObjects.maxImportPayloadBytes=10485760', // for OSS test management/_import_objects
],
},
uiSettings: {
Expand Down

0 comments on commit 1885dda

Please sign in to comment.