mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Avoid validating saved object migrationVersion in tests where not needed (#35010)
* Avoid validating migrationVersion in tests where not needed * Ensure migrationVersion is at least defined
This commit is contained in:
parent
e5cabda964
commit
cd0db0d07c
10 changed files with 21 additions and 37 deletions
|
@ -66,9 +66,7 @@ export default function ({ getService }) {
|
|||
uiStateJSON: resp.body.saved_objects[0].attributes.uiStateJSON,
|
||||
kibanaSavedObjectMeta: resp.body.saved_objects[0].attributes.kibanaSavedObjectMeta
|
||||
},
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0',
|
||||
},
|
||||
migrationVersion: resp.body.saved_objects[0].migrationVersion,
|
||||
references: [{
|
||||
name: 'kibanaSavedObjectMeta.searchSourceJSON.index',
|
||||
type: 'index-pattern',
|
||||
|
@ -96,6 +94,7 @@ export default function ({ getService }) {
|
|||
}
|
||||
]
|
||||
});
|
||||
expect(resp.body.saved_objects[0].migrationVersion).to.be.ok();
|
||||
})
|
||||
));
|
||||
});
|
||||
|
|
|
@ -47,9 +47,7 @@ export default function ({ getService }) {
|
|||
expect(resp.body).to.eql({
|
||||
id: resp.body.id,
|
||||
type: 'visualization',
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0'
|
||||
},
|
||||
migrationVersion: resp.body.migrationVersion,
|
||||
updated_at: resp.body.updated_at,
|
||||
version: 'WzgsMV0=',
|
||||
attributes: {
|
||||
|
@ -57,6 +55,7 @@ export default function ({ getService }) {
|
|||
},
|
||||
references: [],
|
||||
});
|
||||
expect(resp.body.migrationVersion).to.be.ok();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -89,9 +88,7 @@ export default function ({ getService }) {
|
|||
expect(resp.body).to.eql({
|
||||
id: resp.body.id,
|
||||
type: 'visualization',
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0'
|
||||
},
|
||||
migrationVersion: resp.body.migrationVersion,
|
||||
updated_at: resp.body.updated_at,
|
||||
version: 'WzAsMV0=',
|
||||
attributes: {
|
||||
|
@ -99,6 +96,7 @@ export default function ({ getService }) {
|
|||
},
|
||||
references: [],
|
||||
});
|
||||
expect(resp.body.migrationVersion).to.be.ok();
|
||||
});
|
||||
|
||||
expect(await es.indices.exists({ index: '.kibana' }))
|
||||
|
|
|
@ -220,9 +220,7 @@ export default function ({ getService }) {
|
|||
version: 1,
|
||||
},
|
||||
id: 'be3733a0-9efe-11e7-acb3-3dab96693fab',
|
||||
migrationVersion: {
|
||||
dashboard: '7.0.0',
|
||||
},
|
||||
migrationVersion: objects[0].migrationVersion,
|
||||
references: [
|
||||
{
|
||||
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
|
||||
|
@ -234,6 +232,7 @@ export default function ({ getService }) {
|
|||
updated_at: '2017-09-21T18:57:40.826Z',
|
||||
version: objects[0].version,
|
||||
}]);
|
||||
expect(objects[0].migrationVersion).to.be.ok();
|
||||
expect(() => JSON.parse(objects[0].attributes.kibanaSavedObjectMeta.searchSourceJSON)).not.to.throwError();
|
||||
expect(() => JSON.parse(objects[0].attributes.optionsJSON)).not.to.throwError();
|
||||
expect(() => JSON.parse(objects[0].attributes.panelsJSON)).not.to.throwError();
|
||||
|
@ -273,9 +272,7 @@ export default function ({ getService }) {
|
|||
version: 1,
|
||||
},
|
||||
id: 'be3733a0-9efe-11e7-acb3-3dab96693fab',
|
||||
migrationVersion: {
|
||||
dashboard: '7.0.0',
|
||||
},
|
||||
migrationVersion: objects[0].migrationVersion,
|
||||
references: [
|
||||
{
|
||||
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
|
||||
|
@ -287,6 +284,7 @@ export default function ({ getService }) {
|
|||
updated_at: '2017-09-21T18:57:40.826Z',
|
||||
version: objects[0].version,
|
||||
}]);
|
||||
expect(objects[0].migrationVersion).to.be.ok();
|
||||
expect(() => JSON.parse(objects[0].attributes.kibanaSavedObjectMeta.searchSourceJSON)).not.to.throwError();
|
||||
expect(() => JSON.parse(objects[0].attributes.optionsJSON)).not.to.throwError();
|
||||
expect(() => JSON.parse(objects[0].attributes.panelsJSON)).not.to.throwError();
|
||||
|
@ -331,9 +329,7 @@ export default function ({ getService }) {
|
|||
version: 1,
|
||||
},
|
||||
id: 'be3733a0-9efe-11e7-acb3-3dab96693fab',
|
||||
migrationVersion: {
|
||||
dashboard: '7.0.0',
|
||||
},
|
||||
migrationVersion: objects[0].migrationVersion,
|
||||
references: [
|
||||
{
|
||||
id: 'dd7caf20-9efd-11e7-acb3-3dab96693fab',
|
||||
|
@ -345,6 +341,7 @@ export default function ({ getService }) {
|
|||
updated_at: '2017-09-21T18:57:40.826Z',
|
||||
version: objects[0].version,
|
||||
}]);
|
||||
expect(objects[0].migrationVersion).to.be.ok();
|
||||
expect(() => JSON.parse(objects[0].attributes.kibanaSavedObjectMeta.searchSourceJSON)).not.to.throwError();
|
||||
expect(() => JSON.parse(objects[0].attributes.optionsJSON)).not.to.throwError();
|
||||
expect(() => JSON.parse(objects[0].attributes.panelsJSON)).not.to.throwError();
|
||||
|
|
|
@ -46,9 +46,7 @@ export default function ({ getService }) {
|
|||
attributes: {
|
||||
'title': 'Count of requests'
|
||||
},
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0',
|
||||
},
|
||||
migrationVersion: resp.body.saved_objects[0].migrationVersion,
|
||||
references: [
|
||||
{
|
||||
id: '91200a00-9efd-11e7-acb3-3dab96693fab',
|
||||
|
@ -60,6 +58,7 @@ export default function ({ getService }) {
|
|||
}
|
||||
]
|
||||
});
|
||||
expect(resp.body.saved_objects[0].migrationVersion).to.be.ok();
|
||||
})
|
||||
));
|
||||
|
||||
|
|
|
@ -39,9 +39,7 @@ export default function ({ getService }) {
|
|||
type: 'visualization',
|
||||
updated_at: '2017-09-21T18:51:23.794Z',
|
||||
version: resp.body.version,
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0',
|
||||
},
|
||||
migrationVersion: resp.body.migrationVersion,
|
||||
attributes: {
|
||||
title: 'Count of requests',
|
||||
description: '',
|
||||
|
@ -57,6 +55,7 @@ export default function ({ getService }) {
|
|||
id: '91200a00-9efd-11e7-acb3-3dab96693fab',
|
||||
}],
|
||||
});
|
||||
expect(resp.body.migrationVersion).to.be.ok();
|
||||
})
|
||||
));
|
||||
|
||||
|
|
|
@ -89,9 +89,7 @@ export function bulkGetTestSuiteFactory(esArchiver: any, supertest: SuperTest<an
|
|||
{
|
||||
id: `${getIdPrefix(spaceId)}dd7caf20-9efd-11e7-acb3-3dab96693fab`,
|
||||
type: 'visualization',
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0',
|
||||
},
|
||||
migrationVersion: resp.body.saved_objects[0].migrationVersion,
|
||||
updated_at: '2017-09-21T18:51:23.794Z',
|
||||
version: resp.body.saved_objects[0].version,
|
||||
attributes: {
|
||||
|
|
|
@ -58,9 +58,7 @@ export function createTestSuiteFactory(es: any, esArchiver: any, supertest: Supe
|
|||
|
||||
expect(resp.body).to.eql({
|
||||
id: resp.body.id,
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0',
|
||||
},
|
||||
migrationVersion: resp.body.migrationVersion,
|
||||
type: spaceAwareType,
|
||||
updated_at: resp.body.updated_at,
|
||||
version: resp.body.version,
|
||||
|
|
|
@ -71,7 +71,7 @@ export function exportTestSuiteFactory(esArchiver: any, supertest: SuperTest<any
|
|||
id: `${getIdPrefix(spaceId)}91200a00-9efd-11e7-acb3-3dab96693fab`,
|
||||
},
|
||||
],
|
||||
migrationVersion: { visualization: '7.1.0' },
|
||||
migrationVersion: response.migrationVersion,
|
||||
updated_at: '2017-09-21T18:51:23.794Z',
|
||||
});
|
||||
};
|
||||
|
|
|
@ -99,9 +99,7 @@ export function findTestSuiteFactory(esArchiver: any, supertest: SuperTest<any>)
|
|||
attributes: {
|
||||
title: 'Count of requests',
|
||||
},
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0',
|
||||
},
|
||||
migrationVersion: resp.body.saved_objects[0].migrationVersion,
|
||||
references: [
|
||||
{
|
||||
id: `${getIdPrefix(spaceId)}91200a00-9efd-11e7-acb3-3dab96693fab`,
|
||||
|
|
|
@ -95,9 +95,7 @@ export function getTestSuiteFactory(esArchiver: any, supertest: SuperTest<any>)
|
|||
expect(resp.body).to.eql({
|
||||
id: `${getIdPrefix(spaceId)}dd7caf20-9efd-11e7-acb3-3dab96693fab`,
|
||||
type: 'visualization',
|
||||
migrationVersion: {
|
||||
visualization: '7.1.0',
|
||||
},
|
||||
migrationVersion: resp.body.migrationVersion,
|
||||
updated_at: '2017-09-21T18:51:23.794Z',
|
||||
version: resp.body.version,
|
||||
attributes: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue